im new to ASP.NET and i made a table and put some data in it to test it ... and i made a text box and a button , i want to search the database and retrieve the information in a grid view !!
here's my code
SqlConnection q1 = new SqlConnection(SqlDataSource1.ConnectionString);
SqlCommand cmd1 = new SqlCommand("SELECT * FROM [Drs] WHERE ([Name] = @Name) ", q1);
cmd1.Parameters.AddWithValue("@Name", TextBox1.Text);
q1.Open();
SqlDataReader dr = cmd1.ExecuteReader();
/// of course i put the Using System.Data.Sqlclient ;
but there's nothing appears in the grid view
im using VS2010
Bookmarks