Re: What's the diff. between DataSet and DataTable and other Basic Q's



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

.



Relevant Pages

  • Re: How to insert data from strongly typed dataset into database (jbx01)
    ... I had an XSD ... database based on the XSD schema, ... I'm receiving XML files ... typed dataset instance from the XMLDocument instance created off an XML ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: More advanced examples for the impatient "newby"
    ... but the key to success will be the design of your database. ... Set the bindingsource datasource to the typed dataset and datamember to the ... Bind the datagridview to the the bindingsource (I only do this AFTER I ... The example I want to use in my experiments is a recipe management ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: INSERT Problem
    ... values then calling Update. ... When Update is called, your explicit values ... I have a typed dataset that I created using VS2008. ... It's been a while since I messed with database stuff. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: More advanced examples for the impatient "newby"
    ... after creating my typed dataset, ... Assuming the database is designed correctly, ... Bind the datagridview to the the bindingsource (I only do this AFTER ... The example I want to use in my experiments is a recipe management ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Typed DataSets in VS2005
    ... The hard-coded values are pointing to our development database. ... Or are you talking about another config file? ... I always taken the connection string via ... hradcoded to create a typed dataset for you.. ...
    (microsoft.public.dotnet.languages.csharp)