473,499 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gridview and Relational data

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.
Apr 16 '06 #1
2 1226
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.

Apr 16 '06 #2
Thanks Oren,
OK. I'll do that,
I thought there is an easier way, VS 2005 made us lazy ;)
"Oren" <Or**@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
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.

Apr 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1680
by: s.gregory | last post by:
My page layout is like this: Page >DataList (databound using ObjectDataSource1 contained in page) >>Items >>>UserControl >>>>GridView (databound using another ObjectDataSource2 contained in...
4
7587
by: Congero | last post by:
I'm trying to find a way to bind hierarchical data to a gridview control. I've been able to do this with some third party controls and was wondering if this functionality is available with the...
4
2027
by: Dabbler | last post by:
I need to convert a CompanyId in one table to Company Name from another table for an ItemTemplate. I thought I would just add another SqlDataSource but not sure how to eval with the CompanyId...
0
1581
by: H5N1 | last post by:
Hi there It seems I've spotted interesting problem in a job I've got to do. I have 3 tables: meals, employees, and intersecting table: meals_for_employees with bool field meaning, that given...
0
1369
by: ack95 | last post by:
Simply question How can I DataBind() a DataViewManager to a GridView in ASP.NET? Question in Detail We have a DataSet with relational DataTables (total of 5). We are generating emails with...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5479
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.