Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a row to a dataset
Message
 
To
06/08/2004 14:08:28
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00931376
Message ID:
00931389
Views:
16
Mike I found a sample for you

i.e.
DataTable workTable = new DataTable("Customers");

DataColumn workCol = workTable.Columns.Add("CustID", typeof(Int32));
workCol.AllowDBNull = false;
workCol.Unique = true;

workTable.Columns.Add("CustLName", typeof(String));
workTable.Columns.Add("CustFName", typeof(String));
workTable.Columns.Add("Purchases", typeof(Double));
HTH
--> Shawn


>Actually, it was a mistake on my part. Here is the modified code:
>
> Dim rowNew As DataRow
> gModelTagsDS.Tables.Add("header")
> rowNew = gModelTagsDS.Tables("header").NewRow()
> rowNew("model") = Trim(txtModelNum.Text)
> rowNew("modeldesc") = Trim(txtModelDesc.Text)
> rowNew("partdesc") = desc
> rowNew("quantity") = temp
>
>
>I didn't have the table set up in my dataset, as I assumed it would automatically be created. Now it says that those columns do not exist in my table, so how do I define my table?
>
>Thanks Kevin!
Shawn Dorion
Geo Sektor Dot Com
Website: http://www.geosektor.com

Web Hosting Plans
Visit : http://WebHosting.Applications4u.com/
Previous
Reply
Map
View

Click here to load this message in the networking platform