PC Review


Reply
Thread Tools Rate Thread

When does the Dataset load?

 
 
Vayse
Guest
Posts: n/a
 
      9th Dec 2005
Lets say I create a databound Form with the datasource config wizard.
It has a Dataset -> TestDataSet, and two table adapters.
When the form loads, I have code like so

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.PermissionsTableAdapter.Fill(Me.TestDataSet.Permissions)
Me.UsersTableAdapter.Fill(Me.TestDataSet.Users)
End Sub

I'm a bit unclear on the order of what happens. What are the steps?
Does the Dataset load the schema first, then the data?
Or does only the schema load, then the table adapters fill with the
necessary data?

Thanks
Vayse


 
Reply With Quote
 
 
 
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      9th Dec 2005
In your code, the adapter is going to handle loading the schema and the data
so for all intents and purposes, they happen together. when you call Fill,
that's when the adapter moves the data but before it can move it, it looks
to the db to determine what the data looks like. If you have an untyped
dataset then it will build the tables , otherwise it will have to have
matching columns or table/column mappings - if not then it won't know where
to move them and will probably thrown an exception
"Vayse" <(E-Mail Removed)> wrote in message
news:%23E2i%23nN$(E-Mail Removed)...
> Lets say I create a databound Form with the datasource config wizard.
> It has a Dataset -> TestDataSet, and two table adapters.
> When the form loads, I have code like so
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Me.PermissionsTableAdapter.Fill(Me.TestDataSet.Permissions)
> Me.UsersTableAdapter.Fill(Me.TestDataSet.Users)
> End Sub
>
> I'm a bit unclear on the order of what happens. What are the steps?
> Does the Dataset load the schema first, then the data?
> Or does only the schema load, then the table adapters fill with the
> necessary data?
>
> Thanks
> Vayse
>



 
Reply With Quote
 
Vayse
Guest
Posts: n/a
 
      9th Dec 2005
Well, the wizard creates a typed Dataset, as far as I know.
So, the dataset is loaded first, so the adapter knows where to look for the
db?

"W.G. Ryan - MVP" <(E-Mail Removed)> wrote in message
news:uuSCzuN$(E-Mail Removed)...
> In your code, the adapter is going to handle loading the schema and the
> data so for all intents and purposes, they happen together. when you call
> Fill, that's when the adapter moves the data but before it can move it, it
> looks to the db to determine what the data looks like. If you have an
> untyped dataset then it will build the tables , otherwise it will have to
> have matching columns or table/column mappings - if not then it won't know
> where to move them and will probably thrown an exception
> "Vayse" <(E-Mail Removed)> wrote in message
> news:%23E2i%23nN$(E-Mail Removed)...
>> Lets say I create a databound Form with the datasource config wizard.
>> It has a Dataset -> TestDataSet, and two table adapters.
>> When the form loads, I have code like so
>>
>> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles MyBase.Load
>> Me.PermissionsTableAdapter.Fill(Me.TestDataSet.Permissions)
>> Me.UsersTableAdapter.Fill(Me.TestDataSet.Users)
>> End Sub
>>
>> I'm a bit unclear on the order of what happens. What are the steps?
>> Does the Dataset load the schema first, then the data?
>> Or does only the schema load, then the table adapters fill with the
>> necessary data?
>>
>> Thanks
>> Vayse
>>

>
>



 
Reply With Quote
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      9th Dec 2005
If you're using typed datasets than the schema is already designed . Fill
is what triggers the data to be moved into the ds.
"Vayse" <(E-Mail Removed)> wrote in message
news:ubCI$yN$(E-Mail Removed)...
> Well, the wizard creates a typed Dataset, as far as I know.
> So, the dataset is loaded first, so the adapter knows where to look for
> the db?
>
> "W.G. Ryan - MVP" <(E-Mail Removed)> wrote in message
> news:uuSCzuN$(E-Mail Removed)...
>> In your code, the adapter is going to handle loading the schema and the
>> data so for all intents and purposes, they happen together. when you
>> call Fill, that's when the adapter moves the data but before it can move
>> it, it looks to the db to determine what the data looks like. If you
>> have an untyped dataset then it will build the tables , otherwise it will
>> have to have matching columns or table/column mappings - if not then it
>> won't know where to move them and will probably thrown an exception
>> "Vayse" <(E-Mail Removed)> wrote in message
>> news:%23E2i%23nN$(E-Mail Removed)...
>>> Lets say I create a databound Form with the datasource config wizard.
>>> It has a Dataset -> TestDataSet, and two table adapters.
>>> When the form loads, I have code like so
>>>
>>> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
>>> System.EventArgs) Handles MyBase.Load
>>> Me.PermissionsTableAdapter.Fill(Me.TestDataSet.Permissions)
>>> Me.UsersTableAdapter.Fill(Me.TestDataSet.Users)
>>> End Sub
>>>
>>> I'm a bit unclear on the order of what happens. What are the steps?
>>> Does the Dataset load the schema first, then the data?
>>> Or does only the schema load, then the table adapters fill with the
>>> necessary data?
>>>
>>> Thanks
>>> Vayse
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: DataSet does not load =?Utf-8?B?Sm9obiBPbGJlcnQ=?= Microsoft Dot NET Compact Framework 1 18th Sep 2005 09:09 AM
Load XML to DataSet Dave Microsoft C# .NET 0 8th Nov 2004 04:00 PM
how to i load a dataset from a xml(url)? =?Utf-8?B?U3RhbmxleSBKIE1yb2N6ZWs=?= Microsoft Dot NET 4 16th Oct 2004 08:57 PM
How to load dataset from DLL?? Adolf Microsoft ADO .NET 3 19th Jun 2004 05:47 PM
Trying to load a dataset jaime Microsoft C# .NET 4 7th Nov 2003 09:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:57 PM.