Creating Strongly Typed Datasets in VS.NET

Creating Strongly Typed Datasets in VS.NET

Postby AndrewG » Sun 08 Jan 2006 14:36

I have a fully constructed MySQL db, and I'm trying to create a stronlgy typed dataset in VS2003 from it.

Usually I'd create some data adaptors for each table, then choose 'Generate Dataset' from one of them, and then select all the data adaptors, and point them to an empty xsd file.

However, when I try to do that with CoreLabs software, I only get one table in my XSD. If I try to do one at a time, it always overwrites the previous one !

Ideally - I should be able to drag a table from the dbExplorer to my XSD file - but that's not permitted either! Is there an easy way to create an XSD from an existing mySQL db?

Thanks all,


Postby AndrewG » Sun 08 Jan 2006 20:11

OK - managed to do it this way... Table by table, dataadapter by dataadapter... Because the XSD element gets created with the name 'Table' it only adds one at a time. So you have to select a DA, click 'Generate Dataset', then open the XSD, rename the nelay created 'Table' to whatever you want, save the XSD (important), and repeat for the next DA... Painful, but it works at least...


Postby Serious » Tue 10 Jan 2006 14:39

We tested DataSet generation feature of MySqlDataAdapter component and found no problems with it.

Steps we've performed:
1. Create WindowsApplication project
2. Drop on the form MySqlConnection component, configure it
3. Drop on the form 2 MySqlDataAdapters, configure them, execute "Preview" task in designer to refresh table mapping
4. Execute "Generate DataSet..." verb on any adapter
5. "Generate DataSet" form with 2 tables in the "Tables' list box appears. Tables have correct names (in our case: "dept", "emp").
6. Enter DataSet name ("DataSetDeptEmp" in our test), select all tables in the list and press "OK" button.

After these steps typed DataSet "DataSetDeptemp.xsd" was added to the project, "dataSetDeptEmp1" component was added to current form designer. DataSet contains tables we selected.

If you have problems with DataSet generation please describe what step fails or what exactly you're doing.

Test environment: MySQLDirect .NET 3.20.7, Visual Studio 2003, MySQL Server 4.1.

Return to dotConnect for MySQL