473,563 Members | 2,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset and datatables

Hi,

I just wanted to ask a quick question regarding datasets.
I am creating 3 tables using a dataadapter. what i want
to know is that is the relationship created between these
datatables automatically?? Will the integrity rules
automatically be enforced or do i need to recode this in
vb.net?

Also do the datatables created have the same schema as my
underlying database tables? i.e will the datatables also
have primarykeys that are autonumbers (as they were
created in my access DB)?
Jul 21 '05 #1
2 2053
the tables will have the same schema as the query that you use...if you
SELECT Field1, Field2 but there are ...Field50 in the table, only Field1 and
2 will be in the new schema.

You can explicitly set your keys if you want and can create keys that don't
exist on the DB side if you want...the sky is the limit there...Primary Keys,
AutoIncrement, Seeds, all of it.

Check out my article on DataRelations.. ..
http://www.knowdotnet.com/articles/datarelation.html Unless you are using a
Typed DataSet, you'll need to peg the relations using the DataRelation
object.

HTH,

Bill
"Jade" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
Hi,

I just wanted to ask a quick question regarding datasets.
I am creating 3 tables using a dataadapter. what i want
to know is that is the relationship created between these
datatables automatically?? Will the integrity rules
automatically be enforced or do i need to recode this in
vb.net?

Also do the datatables created have the same schema as my
underlying database tables? i.e will the datatables also
have primarykeys that are autonumbers (as they were
created in my access DB)?

Jul 21 '05 #2
Jade,
You need to define the relationships in the DataSet yourself, I find using
an XSD file the easist way to achieve this. Whether or not you enable the
"Typed DataSet" ability of the XSD file. Of course creating DataRelation
objects in code & adding them to a DataSet is a useful alternative.

David Sceppa's book "Microsoft ADO.NET - Core Reference" from MS Press
covers the DataSet, DataTable, DataRelation & Data Adapters in great detail.
It is a good tutorial on ADO.NET as wall as an excellent desk reference once
you know ADO.NET.

Hope this helps
Jay

"Jade" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
Hi,

I just wanted to ask a quick question regarding datasets.
I am creating 3 tables using a dataadapter. what i want
to know is that is the relationship created between these
datatables automatically?? Will the integrity rules
automatically be enforced or do i need to recode this in
vb.net?

Also do the datatables created have the same schema as my
underlying database tables? i.e will the datatables also
have primarykeys that are autonumbers (as they were
created in my access DB)?

Jul 21 '05 #3

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

Similar topics

3
3145
by: Alex Ayzin | last post by:
Hi, I have a problem that might be easy to solve(possibly, I've just overlooked an easy solution). Here we go: I have a dataset with 2 datatables in it. Now, I need to do the following: if ds.table(0).rows(0).item("col1") = ds.table(1).rows(0).item("col2") then txtResult.text = ds.table(1).rows(0).item("col3")
12
23739
by: Marc | last post by:
I have used XMLDataToString = DataSetForXML.GetXml() to get an XML string from a dataset. I am looking for a way to create a dataset from this XML string. I tried DataSetForXML.ReadXml(XMLDataToString) but I received error messages. Does anyone know how to do this without creating a file (disk copy) of this XML data? Thanks for your help....
6
2528
by: Jumping Matt Flash | last post by:
The code i'm writing is using VB .NET and is for a web service returning a dataset, which is in turn to be used by an ASP .NET application displaying a datagrid. I'm currently populating a datagrid using a "select top 1 column 1, column2, column3 from tblTable" statement. As there will only ever be one row returned I want to be able to to...
2
284
by: Jade | last post by:
Hi, I just wanted to ask a quick question regarding datasets. I am creating 3 tables using a dataadapter. what i want to know is that is the relationship created between these datatables automatically?? Will the integrity rules automatically be enforced or do i need to recode this in vb.net? Also do the datatables created have the same...
10
6514
by: dauphian | last post by:
Hello, I am new to .net and am trying to build a report application that queries 4 different tables based on a id, and I need to return them in the same table for easy viewing. Basically, I have one querie that grabs all of the id's I need for the other 4 queries, but I am not sure how to get them into a DataTable or DataSet, or if that...
1
1301
by: Tom W | last post by:
code snipped from MS sample "N-Tier Data Form and Data Layer" example (101 vb.net samples). Public Class frmMain Private dsSupplierProducts as DataSet Private dtSupplier as DataTable Private dtProducts as DataTable Private dvSupplier as DataView Private dvProduct as DataView
9
10904
by: =?Utf-8?B?RGljaw==?= | last post by:
I have a function that creates a DataSet, populates its many DataTables and then returns the DataSet. I want to bind separate controls to each of the DataSet's DataTables, e.g. a separate GridView for each DataTable. As far as I can tell, the ObjectDataSource only binds to the DefaultView of the DataSet's first DataTable. I'd like to know...
1
2279
by: Frederik | last post by:
Hi all, Am I correct when stating that LINQ replaces somewhat DataTables? I have done some reading concerning LINQ, but I'm still puzzled as to whether I should use LINQ or not. My application imports data from an XML file and stores the data in a DataSet (with 3 DataTables in it). The DataTables are used to fill several DataGridViews...
0
1515
by: StefanPienaar | last post by:
Hi Guys Is there any way in c# (or vb.net) to extract a datatable of data from a dataset with multiple datatables which has relationships set up (containing combined data from the datatables)? I currently have 2 datatables in the dataset. The first one contains the header records with columns such as Id, DateCreated, DateModified, etc The...
0
7659
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7882
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5208
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.