The piece of code is something like this:
SqlDataReader dr = null;
SqlConnection conn = null;
try
{
this.radGridView1.MasterGridViewTemplate.AutoGenerateColumns = true;
this.radGridView1.GridElement.BeginUpdate();
DataSet ds = new System.Data.DataSet();
string connectionString = ConfigurationManager.AppSettings["Conn"];
conn = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand("SELECT * FROM Payment");
cmd.Connection = conn;
conn.Open();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(ds);
radGridView1.DataSource = ds.Tables[0].DefaultView;
}
catch (Exception ex)
{
}
finally
{
conn.Close();
dr.Dispose();
}
Although the dataset is returning rows as a resultset, but when the grid loads, it displayes nothing. Is there anything I am missing.
I want to Auto generate the columns.
Thanks,
Saikat