how to build relation between tables ???
-
i have a database which contain 2 tables "table1" and "table2" i had defined primary and foreign keys i had use adapter adap1 for "table1" and adap2 for "table2" now i had generated a dataset "ds" using adap1 and adap2 adap1.fill(ds) adap2.fill(ds) now i want to have a relation in both tables in wizard , we can do this by going into schema of dataset and creating relation but can it be done through code plz help code will be more useful
-
i have a database which contain 2 tables "table1" and "table2" i had defined primary and foreign keys i had use adapter adap1 for "table1" and adap2 for "table2" now i had generated a dataset "ds" using adap1 and adap2 adap1.fill(ds) adap2.fill(ds) now i want to have a relation in both tables in wizard , we can do this by going into schema of dataset and creating relation but can it be done through code plz help code will be more useful
sumit21 wrote: in wizard , we can do this by going into schema of dataset and creating relation but can it be done through code Surely the wizard generates the code for you. It is normally hidden in a region marked something like "Visual Studio Code Generated. Do not edit". So, if you look at that code then you will see how it is done.
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
i have a database which contain 2 tables "table1" and "table2" i had defined primary and foreign keys i had use adapter adap1 for "table1" and adap2 for "table2" now i had generated a dataset "ds" using adap1 and adap2 adap1.fill(ds) adap2.fill(ds) now i want to have a relation in both tables in wizard , we can do this by going into schema of dataset and creating relation but can it be done through code plz help code will be more useful
Yes Sumit you can do that
dim dr as DataRelation dr = new DataRelation("myRelation",ParaentCol,ChildCol) DataSet.Relations.Add(dr)
But in this case u can do only with that dataSet tables itself means if u have two tables in dataset u can make ralationship with the two tables I hope this helps Ishak