Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue
Datatable / Dataset issue Datatable / Dataset issue
Datatable / Dataset issue
Go Back  Xtreme Visual Basic Talk > > > Datatable / Dataset issue


Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2008, 03:53 AM
RJS28UK RJS28UK is offline
Newcomer
 
Join Date: Nov 2007
Posts: 6
Default Datatable / Dataset issue


Morning guys,

Probably a very dumb question but I have a program whereby I create and populate an in memory datatable, which I then add to a data-set.

I then run a couple of updates on the dataset and need to know how to then send these updates down into the in memory datatable :

Here is a mock up of the code structure following the creation and population of the table :

Code:
'Create and populate dataset from datatable

Dim ds As DataSet = New DataSet
ds.Tables.Add("newdatatable")

'Run check and change

For Each dr As DataRow In ds.Tables("newdatatable").Rows

      If dr("Player Name") = "SHARAP" Then
           dr("Player Name") = "SHUT-IT   
      End If
Next

ds.acceptchanges()

'Now what do I put here to update the original datatable?
Reply With Quote
  #2  
Old 09-23-2008, 12:25 PM
martonx martonx is offline
Centurion
 
Join Date: Jan 2007
Location: Szeged, Hungary
Posts: 129
Default

I don't understand you. What do you want exactly?
In your example, there is no datarows in datatable, there is no point a for each next loop in an empty datatable.

I need more info to help you.

If the dataset is only in the memory what kind of original datatable do you want to update?
Reply With Quote
  #3  
Old 09-24-2008, 01:56 AM
RJS28UK RJS28UK is offline
Newcomer
 
Join Date: Nov 2007
Posts: 6
Default

Without meaning to be disrespectful, how hard did you actually try to understand it. It clearly says it was a mock up of the code and not the exact code. This is sensitive information preventing me from displaying the exact code! I also had no need to show you the population of the datatable as I knew this was succesful.

The table is added to the dataset (ds) as newdatatable in the example, then the changes are made to the dataset.... Once again, I've checked this in the real code by temporarily assigning a couple of datagrids and the datatable is not updated with along with the dataset. I was simply hoping someone could give me a one liner which would cause the dataset to update the changes back to the in-memory datatable source itself.

Thanks for looking but it's ok now, not to worry. I'm making the changes directly to the datatable - much simpler all round.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue Datatable / Dataset issue
Datatable / Dataset issue
Datatable / Dataset issue
 
Datatable / Dataset issue
Datatable / Dataset issue
 
-->