How to use DataSet.xsd with ADO.NET DataSet??

  • Thread starter Thread starter Rob R. Ainscough
  • Start date Start date
R

Rob R. Ainscough

In VS 2005

I've used the Data Source Configuration Wizard to create a MyDataSet.xsd,
but I'm lost on how to get anything out of the .xsd into a workable ADO.NET
dataset?? Any suggestions?

Thanks, Rob.
 
You can either open that XSD in VSTudio and it will give you a strongly
typed dataset.

Or you can use the xsd.exe commandline tool to convert it into a st-yped
dataset class.

Of course the XSD schema must comply to be a dataset in the first place ;-)
 
Rob,
I've used the Data Source Configuration Wizard to create a MyDataSet.xsd,
but I'm lost on how to get anything out of the .xsd into a workable
ADO.NET dataset?? Any suggestions?
Because you are talking about the Data Source Configuration Wizard I assume
it is 2005.

Drag than from your toolbox in the tab 'Data' a datagridview on a form
Select propeties from that and take there the property datatasource
Click on the empty box and go down opening the +'s and select the table

Debug.

You will see the table that you have selected.

While doing this, this the designer part is changed.

In the dataset itself is in the version 2005 all code to handle the fills,
updates or whatever which you can use in your code.

If it is VB Net than this code is already generated for you to get the
dataset.

'TODO: This line of code loads data into the 'NorthwindDataSet.Employees'
table. You can move, or remove it, as needed.
Me.EmployeesTableAdapter.Fill(Me.NorthwindDataSet.Employees)

I hope this helps,

Cor
 
Back
Top