Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
note it is windows application.

SELECT [Sch_Date] &"," & [Session] &"," & [Course] &","&[FAculty_Code] AS Message
FROM Tb_SCh_TIme_Table;

when i run the above query output shows as follows;

Message

2/25/2013,1,ARPA,AKR
2/26/2013,2,GMDSS,BAB
2/26/2013,3,MFA,BAB
2/25/2013,4,EFA,BARATH
2/26/2013,4,CTF,CBA


in the run mode i have one Button called Load and one datagridiview.

In datagridview as follows;

Name Message

when i click the Load Button, output i need as follows in datagridview;

In Datagridivew ouput i need as follows;

Name Message

AKR 2/25/2013,1,ARPA
BAB 2/26/2013,2,GMDSS
BAB 2/26/2013,3,MFA
BARATH 2/25/2013,4,EFA
CBA 2/26/2013,4,CTF


for that how can i do using csharp.

note it is windows application.

Please help me.
Posted
Comments
Karthik Harve 2-Mar-13 0:42am    
Have you tried binding the datagridview ? if yes, show us how are you binding the data ?
Sergey Alexandrovich Kryukov 2-Mar-13 0:52am    
What did you try? What's the problem?
—SA

1 solution

C#
private void Loadbutton_Click(object sender, EventArgs e)
        {
          var abc=select............;
            dataGridView1.DataSource = abc.Select(p=>new {p.FAculty_Code,p.Sch_Date,p.Session,p.Course});
        }
 
Share this answer
 
Comments
[no name] 2-Mar-13 2:38am    
private void Loadbutton_Click(object sender, EventArgs e)
{
var abc=select............;
dataGridView1.DataSource = abc.Select(p=>new {p.FAculty_Code,p.Sch_Date,p.Session,p.Course});
}


from your above why did not mention table name?

what does P stands for your above code?


Please help me.

Regards,
Narasiman P.

Please help me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900