TC said:
Hey Cor,
I know that XSD has nothing to do with .csv ;-)
I meant applying the .xsd to the .xml file that was created from the .csv
file.
I also agree, that I need to go from .csv to dataset and then use the
ability to write the .xml file from there.
Thanks,
TC
Ok first things first:
Create a dataset from a .csv
1. Create an ODBC datasource to the folder in which your .csv file exists
Open the ODBC Data Source Administrator
Either use User DSN or System DSN (I will use User)
Click Add
In the Select a driver - Select MS Access Text Driver(*.txt, *.csv)
Click Finish
Input a Data Source Name (and description if you want)
Now unclick "Use Current Directory" and use Select Directory to get
directory holding .csv
Go to options. This is where you can select what file extensions will
be used (if no .txt files just cancel)
2. Open VS if not already open
3. View/Server Explorer
4. Right click Data Connection and select Add Connection
5 Change DataSource to MS ODBC Data Source - OK
6. From dropdown of User/System data source choose your new source
created above
7. You now have a Data Connection to your .csv
8. Add New Item to project - Dataset (name it accordingly)
9. Open (click +) on your dataconnection (Server Explorer)
Open tables and you should see your .csv file
10. Drag it to the .xsd designer (if you have column names in the .csv you
will get column names in the dataset)
You now have a dataset which you can use
Hope this helps
Lloyd Sheen