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.Sql Client.SqlConne ction con;
con.ConnectionS tring = "Data Source=HOME-PC\\SQLEXPRESS; Initial
Catalog=Contact s;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.Sql Client.SqlConne ction con;
con.ConnectionS tring = "Data Source=HOME-PC\\SQLEXPRESS; Initial
Catalog=Contact s;User ID=sa";
con.Open();
Any ideas as to what I am doing wrong?
Thanks in advance!
Comment