Click here to Skip to main content
15,915,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone Refer me how to create Dataset.Xsd in vs2008

thank you,
Posted

1 solution

Try this...:)



C#
using System;
using System.Data;

class Program
{
    static void Main()
    {
	// Create two DataTable instances.
	DataTable table1 = new DataTable("patients");
	table1.Columns.Add("name");
	table1.Columns.Add("id");
	table1.Rows.Add("sam", 1);
	table1.Rows.Add("mark", 2);

	DataTable table2 = new DataTable("medications");
	table2.Columns.Add("id");
	table2.Columns.Add("medication");
	table2.Rows.Add(1, "atenolol");
	table2.Rows.Add(2, "amoxicillin");

	// Create a DataSet and put both tables in it.
	DataSet set = new DataSet("office");
	set.Tables.Add(table1);
	set.Tables.Add(table2);

	// Visualize DataSet.
	Console.WriteLine(set.GetXml());
    }
}



http://support.microsoft.com/kb/320714[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900