Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

how to display data in gridview?

Last post 05-12-2008 8:05 AM by sainyam. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-06-2008 9:18 PM

    how to display data in gridview?

    Hi

     I have  2 tables in database as follows:

    table1: 

    id             name          state id      

    1              aaa              1,2

    2              bbb              1,3 

    table2:

    id          state

    1            ak

    2            ny

    3            jk

    so the problem is that  I want to display all the data of "table1" in a gridview and in place of  "state id" I want to display "statename", for example in place of "1,2" I want to display "ak,ny".

    How to do this?

    Please help me.

    Thanks

    • Post Points: 10
  • 05-12-2008 8:05 AM In reply to

    • sainyam
    • Not Ranked
    • Joined on 05-28-2007
    • India
    • Junior Member
    • Points 140

    Re: how to display data in gridview?

     just change the query you are using to bind the grid, it should be like this,

    Select table1.*,table2.* from table1

    inner join table2 on

    tabe1.stateid=table2.id 

    ♫♪...Sainyam Chandra... ♫♪

    I can, therefore I am.
    • Post Points: 5
Page 1 of 1 (2 items)