ok i'm new to this whole .net scene so i have been battling trying to find examples on how to add a newly created table into the database (connection)?
Here's what i have so far!
//create table
DataTable table = new DataTable("MyTa ble");
table.Columns.A dd(new DataColumn("Nam e", Type.GetType("S ystem.String")) );
table.Columns.A dd(new DataColumn("Age ", Type.GetType("S ystem.Byte")));
//add a row of data
DataRow dataRow = table.NewRow();
dataRow["Name"] = "John";
dataRow["Age"] = 30;
table.Rows.Add( dataRow);
//??????????????? ??????????
.
.
(Here's where i'm stuck)
How do I add my table above to the db connection below?
.
.
//??????????????? ??????????
//create database connection
OleDbConnection dbConn = new OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;Data Source=" + DBFULLNAME);
------------------------------------------------------
sorry i know their must be an example somewhere but have been searching for hours with no luck at all!
thanks for any help.
Here's what i have so far!
//create table
DataTable table = new DataTable("MyTa ble");
table.Columns.A dd(new DataColumn("Nam e", Type.GetType("S ystem.String")) );
table.Columns.A dd(new DataColumn("Age ", Type.GetType("S ystem.Byte")));
//add a row of data
DataRow dataRow = table.NewRow();
dataRow["Name"] = "John";
dataRow["Age"] = 30;
table.Rows.Add( dataRow);
//??????????????? ??????????
.
.
(Here's where i'm stuck)
How do I add my table above to the db connection below?
.
.
//??????????????? ??????????
//create database connection
OleDbConnection dbConn = new OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;Data Source=" + DBFULLNAME);
------------------------------------------------------
sorry i know their must be an example somewhere but have been searching for hours with no luck at all!
thanks for any help.
Comment