L
lakshmi
Hi I'm using a SqlDataReader to read results from a SQL
view that returns 10 columns.
Is there anyway I can reader the columns based on their
names rather than their position?
strQuery = "SELECT customerid, orderno from orders where
orderID = 1";
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
myOrderNo = reader.GetInt32(1);
}
instead of using reader.GetInt32(1), is there any syntax
that will support reader("OrderNo") or something like that?
Thanks for your help.
view that returns 10 columns.
Is there anyway I can reader the columns based on their
names rather than their position?
strQuery = "SELECT customerid, orderno from orders where
orderID = 1";
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
myOrderNo = reader.GetInt32(1);
}
instead of using reader.GetInt32(1), is there any syntax
that will support reader("OrderNo") or something like that?
Thanks for your help.