i have this code as following:
SqlConnection myConn= new SqlConnection(ConnInfo);
SqlCommand myComm=new SqlCommand("Select * from tblProject",myConn);
myConn.Open();
SqlDataReader dr= myComm.ExecuteReader();
if (dr.HasRows)
{
dgProject.DataSource=dr;
dgProject.Refresh();
}
dr.Close();
myComm.Dispose();
myConn.Close();
myConn.Dispose();
when i run the application ,it enteres the debug mode and a green line in dgProject.Refresh(); is appeared and also a window box which says
"an unhandled exception of type 'System.Exception' occured in System.windows.form.dll
Additional information: Complex DataBinding accepts as a data source either an IList or an IListSource"
where did i make a mistake?
SqlConnection myConn= new SqlConnection(ConnInfo);
SqlCommand myComm=new SqlCommand("Select * from tblProject",myConn);
myConn.Open();
SqlDataReader dr= myComm.ExecuteReader();
if (dr.HasRows)
{
dgProject.DataSource=dr;
dgProject.Refresh();
}
dr.Close();
myComm.Dispose();
myConn.Close();
myConn.Dispose();
when i run the application ,it enteres the debug mode and a green line in dgProject.Refresh(); is appeared and also a window box which says
"an unhandled exception of type 'System.Exception' occured in System.windows.form.dll
Additional information: Complex DataBinding accepts as a data source either an IList or an IListSource"
where did i make a mistake?