“Use of unassigned variable” error
问题 I am developing this website in ASP.NET and using C#. I am Getting the error that :Use of unassigned variable usn. The database is also not empty. My code is: protected void Button1_Click(object sender, EventArgs e) { SqlConnection cn = new SqlConnection(); SqlCommand cm = new SqlCommand(); SqlDataReader dr; cn.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Vijaylaxmi\Desktop\TrainReserveold\App_Data\Database.mdf;Integrated Security=True;User Instance=True"; cn.Open()