cannot read multiple rows from sqldatareader
- by amby
Hi, when i query for only one record/row, sqldatareader is giving correct result but when i query for multiple rows, its giving error on the client side. below is my code. please tell me what is the problem here.
string query = "select * from Customer_Order where orderNumber = " + order;//+" OR orderNumber = 17";
DataTable dt = new DataTable();
Hashtable sendData = new Hashtable();
try
{
using (SqlConnection conn = new SqlConnection(ConnectionString))
{
using (SqlCommand cmd = new SqlCommand(query, conn))
{
conn.Open();
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
dt.Load(dr);
}
}