PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Reading and writing to DataTable question
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Reading and writing to DataTable question
![]() |
Reading and writing to DataTable question |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi
If I fill an untyped DataTable from my SQL stored procedure to present into some web form for manipulation, how should I write the updates back to the DataTable for saving to another insert procedure? Should the schema be stored in memory somewhere? It would be nice to have it as part of a business object but I'm not sure how to store the schema as a property. I guess I could make a another call to the original data object to get the schema before I need to update the DataTable? but that seems wasteful on database connections and doesn't seem quite right to me. I'm looking to develop a fairly simple n-tier application so could do with some pointers on this. Thanks Andrew |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi Andrew,
Do you mean that you need to update the DataTable from the changes that performed on the webpage? If so, try data binding on the webform. This also depends on the what controls you're using on the webpages. If simple controls like TextBoxes, you have to assign the changed value back to DataSet, like the following: http://msdn.microsoft.com/library/d...-us/vbcon/html/ vbtskupdatingexistingrecordsindataset.asp Also, there is a control named GridView which can auto-update the DataTable from UI with data binding. Here is a good article for your reference. http://msdn.microsoft.com/msdnmag/i...ew/default.aspx Since this is an untyped DataSet, the schema is inferred from the filling data, I don't think we need to stored schema information. Because next time you do the filling, the same schema will be created automatically again. Kevin Yu Microsoft Online Community Support ============================================================================ ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ============================================================================ ========================== (This posting is provided "AS IS", with no warranties, and confers no rights.) |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hi Kevin
I'm now using typed DataSets which gives me what I need. Thanks Andrew |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

