M
Mortar
i have the following code:
SqlConnection con = new
SqlConnection("server=myserver;database=myDB;uid=aa;password=aa;");
SqlCommand cmd = new SqlCommand(SQL, con);
con.Open();
dgResults.DataSource = cmd.ExecuteReader();
dgResults.DataBind();
This uses SqlClient and fails on the executereader line. What am I
doing wrong? The code works if I use OleDB.
SqlConnection con = new
SqlConnection("server=myserver;database=myDB;uid=aa;password=aa;");
SqlCommand cmd = new SqlCommand(SQL, con);
con.Open();
dgResults.DataSource = cmd.ExecuteReader();
dgResults.DataBind();
This uses SqlClient and fails on the executereader line. What am I
doing wrong? The code works if I use OleDB.