Dataview into new table ???

  • Thread starter Sjaakie Helderhorst
  • Start date
S

Sjaakie Helderhorst

Hi,

I've come a stage that I'm feeling an absolute idiot.
Struggling with this issue for days and can't find a suitable answer.

Have this dataset which 'amount' value can be updated. Need to send all
records with 'amount > 0' to a webservice as a Datatable. (Ignorant as I
might be) I Dim a new DataView (rowfilter 'amount > 0') and copy this into a
new datatable:


dv = New DataView(ds.Tables("Items"), _
"amount > 0", _
"barcode", _
DataViewRowState.CurrentRows)

Dim dt As New DataTable("Result")
dt = dv.Table.Copy
sendDS.Tables.Add(dt)

However, sending this datatable (dt) to a webservice will send the entire
source dataset (= huge)

What am I doing wrong ...
Is there a more suitable way of achieving this!?

Thanks in advance.
 
M

Martin Dechev

Hi, Sjaakie Helderhorst,

Maybe you can send a new DataSet containing only the DataTable in question.

Hope this helps
Martin
 
G

Guest

Hi, Sjaakie

You might try the following

sendDS = ds.Clone(
Dim copyRows() As DataRow = ds.Tables("Items").Select("amount > 0"
Dim dt As DataTable = sendDS.Tables("Items"
Dim copyRow As DataRo
For Each copyRow In copyRow
dt.ImportRow(copyRow
Nex

Hope this will help

Bin Song , MC

----- Sjaakie Helderhorst wrote: ----

Hi

I've come a stage that I'm feeling an absolute idiot
Struggling with this issue for days and can't find a suitable answer

Have this dataset which 'amount' value can be updated. Need to send al
records with 'amount > 0' to a webservice as a Datatable. (Ignorant as
might be) I Dim a new DataView (rowfilter 'amount > 0') and copy this into
new datatable


dv = New DataView(ds.Tables("Items"),
"amount > 0",
"barcode",
DataViewRowState.CurrentRows

Dim dt As New DataTable("Result"
dt = dv.Table.Cop
sendDS.Tables.Add(dt

However, sending this datatable (dt) to a webservice will send the entir
source dataset (= huge

What am I doing wrong ..
Is there a more suitable way of achieving this!

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top