S
Sherwood
Greetings,
I am using Visual C#.NET 2005 (Express Edition) and want to connect to a SQL
Server 2005 (Express Edition) database. When I attempt to compile the code
below, however, I receive the error message:
"Use of unassigned local variable 'con'"
System.Data.SqlClient.SqlConnection con;
con.ConnectionString = "Data Source=HOME-PC\\SQLEXPRESS;Initial
Catalog=Contacts;User ID=sa";
con.Open();
Any ideas as to what I am doing wrong?
Thanks in advance!
I am using Visual C#.NET 2005 (Express Edition) and want to connect to a SQL
Server 2005 (Express Edition) database. When I attempt to compile the code
below, however, I receive the error message:
"Use of unassigned local variable 'con'"
System.Data.SqlClient.SqlConnection con;
con.ConnectionString = "Data Source=HOME-PC\\SQLEXPRESS;Initial
Catalog=Contacts;User ID=sa";
con.Open();
Any ideas as to what I am doing wrong?
Thanks in advance!