What's the complete process of populating a datagrid using C# from MYSQL? I need help from the very beginning--including establishing a connection to the server. I have been able to successfully connect to my server, but the thing is I can't seem to find an example of using that method to populate a datagrid because most people seem to use the Ole method. Any help is greatly appreciated! =)
Loading
John Charles OlamendyPosted Apr 11, 2007, 5:07 PM
ShashikantPosted Apr 11, 2007, 1:28 PM
Try This..hope this is helpful....
sqlCon.Open();
SqlCommand sqlcmd = new SqlCommand(NAME OF STORED PROC, sqlCon);
sqlcmd.CommandType = CommandType.StoredProcedure;
sqlcmd.CommandText = NAME OF STORED PROC;
SqlDataAdapter sqlDA = new SqlDataAdapter();
sqlDA.SelectCommand = sqlcmd;
DataSet ds = new DataSet();
sqlDA.Fill(ds);
RadGrid2.DataSource = ds;RadGrid2.DataBind();
if (sqlDA != null) sqlDA.Dispose(); if (ds != null) ds.Dispose();