Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 24th, 2007, 05:37 PM
Registered User
 
Join Date: May 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default link 2 tables only for application, not for databa

Hi, anyone,

Please help!

My project is a Web Application. I only want to build relationship with the two tables for the application. But in the database I still keep the two tables without relationship .
So how to code?
Could you let me know.
Thanks.




 
Old May 28th, 2007, 12:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. what do you want to do?? A Sql will do the trick???

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old May 29th, 2007, 07:41 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I am sure there are a number of ways you could enforce a relationship between two attributes in an application, but the obvious go-to would be to use two instances of the DataTable class with a DataRelation.

Code:
Dim dt1 As New DataTable()
...define the columns or fill with data and auto define columns...
Dim dt2 As New DataTable()
...define the columns or fill with data and auto define columns...
Dim rel As New DataRelation("FK_Table1_Table2", dt1.Columns(0), dt2.Columns(0))





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting data from link tables psnow1985 SQL Server ASP 0 March 27th, 2008 03:19 PM
How to link new tables using code to MSAccess Nordiers Access VBA 2 January 10th, 2008 11:35 PM
Link FoxPro tables through OLEDB catudalg Access 2 May 8th, 2007 08:16 AM
Link tables from two different SQL Databases Folorunso Agbeja SQL Server 2000 1 October 19th, 2006 08:23 AM
Link Tables thru VBA Rchanga Access 1 November 20th, 2004 11:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.