Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: "Hendrik" <henkv@xxxxxxxxx>
- Date: 27 Mar 2006 21:24:01 -0800
I'm not too sure what you mean.
Relationships is defined between tables in the dataset designer.
Remember, you do not have to make the dataSet schema look exactly like
the dataBase schema. If you have contraints / indexes on the database
it does not mean you must have it on the dataset as well. Only add the
tables in the dataset which is used on the specific form. Keep in mind
that the typed dataSet is fixed, so if you change the tables in the
dataBase, you must manually go change it in the dataSet as well.
Personally, I use typed datasets. I never drag/drop an adapter or
connection - this I do in code.
You only need one DataAdapter per form. Here is a code example: (its C#
but you will get the idea):
SqlDataAdapter adapReport;
//DatasetSyncReports is my Typed dataSet
DatasetSyncReports dsSyncReport = new DatasetSyncReports();
adapReport = new SqlDataAdapter("SELECT * FROM Report" ,
mSession.Connection);
adapReport.SelectCommand.Transaction = t;
adapReport.Fill(dsSyncReport.Report); //FILL THE Report Table
//Use same adapter - just change the command text
adapReport.CommandText = "SELECT * FROM ReportSection";
adapReport.SelectCommand.Transaction = t;
adapReport.Fill(dsSyncReport.ReportSection); //FILL THE ReportSection
Table
adapReport.CommandText = "SELECT * FROM L_ReportSectionQuestion";
adapReport.SelectCommand.Transaction = t;
adapReport.Fill(dsSyncReport.L_ReportSectionQuestion); //FILL THE
Question Table
.
- References:
- What's the diff. between DataSet and DataTable and other Basic Q's
- From: Burning_Ranger
- Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: Marina Levit [MVP]
- Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: Burning_Ranger
- Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: Hendrik
- Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: Burning_Ranger
- Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: Aziz
- Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: Hendrik
- Re: What's the diff. between DataSet and DataTable and other Basic Q's
- From: Aziz
- What's the diff. between DataSet and DataTable and other Basic Q's
- Prev by Date: Re: Oracle 10g access from 1.1
- Next by Date: Re: How to Insert records from dataset to another data connection
- Previous by thread: Re: What's the diff. between DataSet and DataTable and other Basic Q's
- Next by thread: Cookies and the HTTPcookiecollection
- Index(es):
Relevant Pages
|
|