Please Help Me --The ConnectionString property has not been initialized.

i am using Csharp windows Application.Help ME........... , Urget , Required India
  • 10 years ago

    i am using below code ..compile time no error occurred but run time error occurred( The Connection String property has not been initialized.)how to solve this problem

    Code

    private void button1_Click(object sender, EventArgs e) { //string cnString = Convert.ToString(ConfigurationSettings.AppSettings["DigiBrd"]); //String ConStr = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["DigiBrd"]); ;// System.Configuration.ConfigurationSettings.AppSettings["DigiBrd"].ToString(); OleDbConnection myConn = new OleDbConnection();//System.Configuration.ConfigurationSettings.AppSettings["DigiBrd"]); //myConn.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["DigiBrd"]; myConn.ConnectionString = (Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["DigiBrd"])); OleDbCommand cmd1=new OleDbCommand ("DigBrd", myConn); cmd1.Connection.Open(); OleDbCommand cmd = new OleDbCommand("insert into sample values('" + textBox1.Text + "')", myConn); cmd.ExecuteNonQuery(); MessageBox.Show("Success", "welcome");

        }
    }
    

    Configure File

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perl - The only language that looks the same before and after RSA encryption.” - Keith Bostic