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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sakura

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

    Hi.
    I'm using asp.net and c# language.
    How can i display a GridView using select statement of two column in one table?

    This is my coding:
    Code:
    if (sdr.Read())
    {
      if(namaPembekal.Equals(sdr["namaPembekal"]) && tarikhRo.Equals(sdr["tarikhRo"]))
      {
                       
        Session.Add("namaPembekal",sdr["namaPembekal"]);          
        Session.Add("tarikhRo", sdr["tarikhRo"]);
    
        if((((String)(Session["namaPembekal"])).Equals("namaPembekal")) && ((String)(Session["tarikhRo"])).Equals("tarikhRo"))
          GridView1.DataSourceID = SqlDataSource2.ID;
        GridView1.DataSourceID = txtJourneyDate.Text;
                            
      }
    Please help me.
    Thanks in advance...
    Last edited by Frinavale; Oct 25 '10, 06:56 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags and formatted the question so that it used proper English.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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.

    Comment

    Working...