Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Data;
- namespace Siswa__dan_Mapel
- {
- class Program
- {
- static void Main(string[] args)
- {
- //buat table1
- DataTable Table1 = new DataTable("tabelsiswa");
- Table1.Columns.Add("id");
- Table1.Columns.Add("nama");
- Table1.Rows.Add(1, "okie");
- Table1.Rows.Add(2, "nega");
- //buat dataset dan tambahkan table ke dataset
- DataSet MyDataset = new DataSet("percobaan");
- MyDataset.Tables.Add(Table1);
- //kita tambahkan Prefix dan namespace
- MyDataset.Namespace = "MyNamespace";
- MyDataset.Prefix = "x";
- //tampilkan di console
- Console.WriteLine(MyDataset.GetXml());
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement