G
Gary
Hi all,
I want to bind a Datagrid to Sqlcommand, below is my code
SqlConnection cn = new SqlConnection("Server=winnt;user id =sa;initial
catalog =Northwind");
cn.Open();
SqlCommand cmd = new SqlCommand("select * from employees");
cmd.Connection = cn;
dr = cmd.executereader()
Datagrid1.datasource = dr
Can we bind Datagrid to a command directly or to Data Reader without using
dataAdaptaor ?
TIA,
Gary
I want to bind a Datagrid to Sqlcommand, below is my code
SqlConnection cn = new SqlConnection("Server=winnt;user id =sa;initial
catalog =Northwind");
cn.Open();
SqlCommand cmd = new SqlCommand("select * from employees");
cmd.Connection = cn;
dr = cmd.executereader()
Datagrid1.datasource = dr
Can we bind Datagrid to a command directly or to Data Reader without using
dataAdaptaor ?
TIA,
Gary