G
Guest
I am trying to read multiple rows from an SP into a datalist.
I can easily read and display multiple rows if I use a select statement but when I call an SP to send me a few rows, I only get back the first row. I can also read multiple rows from SP if I have a single select statement in the S
Here is the code:
System.Data.SqlClient.SqlCommand cm;
System.Data.SqlClient.SqlDataReader dr = null;
cm = new System.Data.SqlClient.SqlCommand();
cm.Connection = new System.Data.SqlClient.SqlConnection();
connect......
DataSet ds = new DataSet(); // I don't really need/use this!!!
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.CommandText = "[getAllTransactions]";
add parameters for SP.....
dr = cm.ExecuteReader();
transListData.DataSource=dr;
transListData.DataBind();
dr.Close();
.....
Could someone help?
Thanks
Merdaad
I can easily read and display multiple rows if I use a select statement but when I call an SP to send me a few rows, I only get back the first row. I can also read multiple rows from SP if I have a single select statement in the S
Here is the code:
System.Data.SqlClient.SqlCommand cm;
System.Data.SqlClient.SqlDataReader dr = null;
cm = new System.Data.SqlClient.SqlCommand();
cm.Connection = new System.Data.SqlClient.SqlConnection();
connect......
DataSet ds = new DataSet(); // I don't really need/use this!!!
cm.CommandType = System.Data.CommandType.StoredProcedure;
cm.CommandText = "[getAllTransactions]";
add parameters for SP.....
dr = cm.ExecuteReader();
transListData.DataSource=dr;
transListData.DataBind();
dr.Close();
.....
Could someone help?
Thanks
Merdaad