private void RefreshDataGrid()
{
if (da != null)
{
da.Dispose();
}
if (ds != null)
{
ds.Dispose();
}
SqlConnection conn = ManageConn.getConnection();
string sql = "";
sql = "select sm.mmId,pm.mmName,sm.sId,sm.smName,sm.CreateDate,sm.Tooltips,case when sm.isUsed=1 then 'true' else 'false' end as isUsed,sm.SerialNo,sm.Description ";
sql += "from PGSubMenu as sm inner join PGMainMenu pm ON sm.mmId=pm.sId order by pm.mmName,sm.SerialNo";
SqlCommand cmd = new SqlCommand(sql,conn);
da = new SqlDataAdapter(cmd);
sql = "select sId as mmId,mmName from PGMainMenu order by SerialNo";
conn=ManageConn.getConnection();
cmd = new SqlCommand(sql, conn);
SqlDataAdapter da1 = new SqlDataAdapter(cmd);
da1.Fill(ds, "PGMainMenu");