1. Fill a DataSet with data from the database2. Save the schema with DataSet.WriteXmlSchema()3. Use the schema as input into XSD.exe
xsd /DataSet /language:CS C:\Data\Products.xsd