By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,471 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

display a gridview using select statement of two column in one table

P: n/a
I'm using and c# language.
How can i display a GridView using select statement of two column in one table?

This is my coding:
Expand|Select|Wrap|Line Numbers
  1. if (sdr.Read())
  2. {
  3.   if(namaPembekal.Equals(sdr["namaPembekal"]) && tarikhRo.Equals(sdr["tarikhRo"]))
  4.   {
  6.     Session.Add("namaPembekal",sdr["namaPembekal"]);          
  7.     Session.Add("tarikhRo", sdr["tarikhRo"]);
  9.     if((((String)(Session["namaPembekal"])).Equals("namaPembekal")) && ((String)(Session["tarikhRo"])).Equals("tarikhRo"))
  10.       GridView1.DataSourceID = SqlDataSource2.ID;
  11.     GridView1.DataSourceID = txtJourneyDate.Text;
  13.   }
Please help me.
Thanks in advance...
Oct 24 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,731
I have no idea what you are trying to do in the code you posted.

From what I understand, you need to create a SQL Select statement that selects from more than one column. I'm not sure what you are having problems with in regards to this. Also, you have not posted code that pertains to your question.

Please provide more details.
Oct 25 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.