Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# Typed DataSet Questions
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01310405
Message ID:
01310447
Views:
16
>Ok, here's my next set of newby questions. I am learning but questions still abound.....
>
>I have come up with this code from what other people have posted. In this example, DSCustomer is a typed dataset. I am
>still in a state of foggyness because all I have is bits and pieces.
>
>
>string sSelectCommand = "select * from Customers where CustomerKey = 1";
>
>SqlDataAdapter oDataAdapter = new SqlDataAdapter(sSelectCommand, oConnection);
>DSCustomer oDataSet = new DSCustomer();
>oDataAdapter.Fill(oDataSet, "DSCustomer");
>
>// Add a row
>oDataSet.Tables[0].Rows.Add();
>
>
>
>
>1) What's the syntax for changing the value of a data item in the row?
>
>2) How do I save the changes to the back end?
>
>3) Could someone point me to examples of binding the DS to form controls?

I don't have a lot of time this morning. But real quickly on q1:

Instead of:
oDataSet.Tables[0].Rows.Add();
Use:
DSCustomer.DSCustomersRow row = new DSCustomer.DSCustomersRow();
row.CustomerName = "Bob"; 
oDataSet.DSCustomers.Rows.Add(row);
See how I'm using the typed objects rather than the Tables[0]
Previous
Reply
Map
View

Click here to load this message in the networking platform