Click here to Skip to main content
15,905,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All

I have A Dataset and i also created some rows, but i want to add this table in my database

how is that possible..??

plz help...

DataSet ds1 = new DataSet();

           DataTable dt = new DataTable("Emp");

           dt.Columns.Add("Name",typeof(string));
           dt.Columns.Add("Address",typeof(string));
           dt.Columns.Add("Phone", typeof(string));

           DataRow dr = dt.NewRow();
           dr["Name"] = "Sandeep Aparajit";
           dr["Address"] = "Redmond USA";
           dr["Phone"] = "425-000-0000";
           dt.Rows.Add(dr);

           ds1.Tables.Add(dt);

           dataGridView2.DataSource = ds1.Tables[0];
Posted
Updated 14-May-13 2:58am
v2

1 solution

Hello,

I recommend you to start read here: ADO.NET -> http://msdn.microsoft.com/en-us/library/e80y5yhx.aspx[^]

Bye.
 
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