Note it is windows application
Code as follows in the form load,
int iRow = 0;
try
{
DGV_Fac_SMS.ColumnCount = 4;
sql = "Select S.Faculty_Code, (select F.Mobile_No from Tb_SCH_Faculty_Details F where F.Faculty_Code = S.Faculty_Code) as MobileNo from Tb_SCh_TIme_Table S group by S.Faculty_Code";
oledr = GFun.ReadAcessSql(sql);
while (oledr.Read())
{
DGV_Fac_SMS.Rows.Add();
DGV_Fac_SMS[0, iRow].Value = oledr[0].ToString();
DGV_Fac_SMS[1, iRow].Value = oledr[1].ToString();
sql = "Select [Sch_Date] & ',' & [Session] & ',' & [Course] as Message FROM Tb_SCH_TIme_Table where [Faculty_Code] = '" + oledr[0].ToString() + "' ";
oledrmsg = GFun.ReadAcessSql(sql);
while (oledrmsg.Read())
{
DGV_Fac_SMS[2, iRow].Value = DGV_Fac_SMS[2, iRow].Value + oledrmsg[0].ToString();
}
iRow = iRow + 1;
oledrmsg.Close();
}
oledr.Close();
}
catch (Exception ex1)
{
MessageBox.Show(ex1.ToString(), "Error", MessageBoxButtons.OK);
this.Cursor = Cursors.Arrow;
return;
}
when i run output as follows in datagridview;
Name Mobile Message
AKR 97090578905 2/25/2013,1,REO2/26/2013,2,MFA
But i want the the above output in datagridiview, the below one as follows;
Name Mobile Message
AKR 97090578905 2/25/2013,1,REO
2/26/2013,2,MFA
how can i get the above output.
in my code what changes i can made to get the output.
Please help me.
Note it is windows application.
[edit]Code blocks added[/edit]