Dataset and datatables

  • Thread starter Thread starter Jade
  • Start date Start date
J

Jade

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)?
 
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...PrimaryKeys,
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,
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
 
Back
Top