Gridview and Relational data

Discussion in 'ASP .Net' started by Saber, Apr 16, 2006.

  1. Saber

    Saber Guest

    I've two tables in SQL Server 2000:

    tblAds: ADid (PK), ADname, ADcatID
    tblCategories: CatID (PK), CatName

    and some data for example:

    tblAds
    ^^^^^^
    1,intel,3
    2,amd,3
    3,sony,5
    4,toshiba,5


    tblCategories
    ^^^^^^^^^^
    1,food
    2,travel
    3,computer
    4,application
    5,tv

    I've a GridView and I want when binding tblAds in GridView,
    the user see:
    1,intel,computer instead of 1,intel,3
    of course there is a relationship from tblAds(ADcatID) to
    tblCategories(CatID) but I don't know
    how to show that in GridView and also be able to delete and update.
    I have to do some hard coding or there is a solution in VS 2005 wizards?

    Thanks
    Saber S.
    Saber, Apr 16, 2006
    #1
    1. Advertising

  2. hi Saber,

    Create a stored procedure with the logic that you need and retrieves it to
    your page.

    Oren.

    "Saber" wrote:

    > I've two tables in SQL Server 2000:
    >
    > tblAds: ADid (PK), ADname, ADcatID
    > tblCategories: CatID (PK), CatName
    >
    > and some data for example:
    >
    > tblAds
    > ^^^^^^
    > 1,intel,3
    > 2,amd,3
    > 3,sony,5
    > 4,toshiba,5
    >
    >
    > tblCategories
    > ^^^^^^^^^^
    > 1,food
    > 2,travel
    > 3,computer
    > 4,application
    > 5,tv
    >
    > I've a GridView and I want when binding tblAds in GridView,
    > the user see:
    > 1,intel,computer instead of 1,intel,3
    > of course there is a relationship from tblAds(ADcatID) to
    > tblCategories(CatID) but I don't know
    > how to show that in GridView and also be able to delete and update.
    > I have to do some hard coding or there is a solution in VS 2005 wizards?
    >
    > Thanks
    > Saber S.
    >
    >
    >
    =?Utf-8?B?T3Jlbg==?=, Apr 16, 2006
    #2
    1. Advertising

  3. Saber

    Saber Guest

    Thanks Oren,
    OK. I'll do that,
    I thought there is an easier way, VS 2005 made us lazy ;)


    "Oren" <> wrote in message
    news:...
    > hi Saber,
    >
    > Create a stored procedure with the logic that you need and retrieves it to
    > your page.
    >
    > Oren.
    >
    > "Saber" wrote:
    >
    >> I've two tables in SQL Server 2000:
    >>
    >> tblAds: ADid (PK), ADname, ADcatID
    >> tblCategories: CatID (PK), CatName
    >>
    >> and some data for example:
    >>
    >> tblAds
    >> ^^^^^^
    >> 1,intel,3
    >> 2,amd,3
    >> 3,sony,5
    >> 4,toshiba,5
    >>
    >>
    >> tblCategories
    >> ^^^^^^^^^^
    >> 1,food
    >> 2,travel
    >> 3,computer
    >> 4,application
    >> 5,tv
    >>
    >> I've a GridView and I want when binding tblAds in GridView,
    >> the user see:
    >> 1,intel,computer instead of 1,intel,3
    >> of course there is a relationship from tblAds(ADcatID) to
    >> tblCategories(CatID) but I don't know
    >> how to show that in GridView and also be able to delete and update.
    >> I have to do some hard coding or there is a solution in VS 2005 wizards?
    >>
    >> Thanks
    >> Saber S.
    >>
    >>
    >>
    Saber, Apr 17, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carse
    Replies:
    1
    Views:
    3,652
    Carse
    Jan 28, 2005
  2. Amol
    Replies:
    0
    Views:
    367
  3. Stylus Studio
    Replies:
    0
    Views:
    362
    Stylus Studio
    Sep 20, 2005
  4. Pradeep
    Replies:
    9
    Views:
    370
    Joe Kesselman
    Sep 8, 2006
  5. =?Utf-8?B?VG9iaW4=?=
    Replies:
    0
    Views:
    278
    =?Utf-8?B?VG9iaW4=?=
    Nov 1, 2006
Loading...

Share This Page