469,927 Members | 1,874 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Filling a Dataset

I have Dataset that I need to filter into another Dataset for display and I
can not find out how to do this. I have found methods for copying a Dataset
but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)
Feb 21 '07 #1
11 2296
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
>I have Dataset that I need to filter into another Dataset for display and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)


Feb 21 '07 #2
Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don't see any way to get the filtered data from the DataView into my new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com. ..
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
>>I have Dataset that I need to filter into another Dataset for display and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)



Feb 21 '07 #3
Sid,

Why do you need to get the data into a new dataset/datatable?

Just use the filtered dataview for display, that's what it is for.

The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.

Kerry Moorman
"Sid Price" wrote:
Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don't see any way to get the filtered data from the DataView into my new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com. ..
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
>I have Dataset that I need to filter into another Dataset for display and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)



Feb 21 '07 #4
Kerry,

The application does its data processing using a Dataset in many areas. This
particular Dataset is built from an imported CSV rather than a database,
which is where many other Datasets come from. We do not want to duplicate
the functionality of our application to process this imported data, we want
to use the code that already exists, i.e. the code that expects data input
from a Dataset. It is not simply a matter of display.

Sid.

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:68**********************************@microsof t.com...
Sid,

Why do you need to get the data into a new dataset/datatable?

Just use the filtered dataview for display, that's what it is for.

The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.

Kerry Moorman
"Sid Price" wrote:
>Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don't see any way to get the filtered data from the DataView into my
new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com ...
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for display
and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)




Feb 21 '07 #5
CSV + 'BULK INSERT' = SQL Server

lose the training wheels; it doesn't make sense to reinvent the wheel


On Feb 21, 11:37 am, "Sid Price" <s...@nowhere.comwrote:
Kerry,

The application does its data processing using a Dataset in many areas. This
particular Dataset is built from an imported CSV rather than a database,
which is where many other Datasets come from. We do not want to duplicate
the functionality of our application to process this imported data, we want
to use the code that already exists, i.e. the code that expects data input
from a Dataset. It is not simply a matter of display.

Sid.

"Kerry Moorman" <KerryMoor...@discussions.microsoft.comwrote in message

news:68**********************************@microsof t.com...
Sid,
Why do you need to get the data into a new dataset/datatable?
Just use the filtered dataview for display, that's what it is for.
The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.
Kerry Moorman
"Sid Price" wrote:
Robin,
DataView.ToTable is not a defined method ... I am using VB.NET 2003.
I don't see any way to get the filtered data from the DataView into my
new
Dataset.
Sid.
"RobinS" <Rob...@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com ...
You can use a dataview of the table for display.
dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"
Then use the dataview to display.
You can also copy the dataview to a new table using dv.ToTable.
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <s...@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for display
and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.
I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to my
Dataset object.
Any pointers would be much appreciated.
Sid.
(VB.NET 2003)- Hide quoted text -

- Show quoted text -

Feb 22 '07 #6
Well that is truly an very informative message ... NOT.

Perhaps you could explain how changing the source of the data would would
help us achieve our goal when it is clear our problem is associated with
DataAdapter and DataSet objects. Maybe you really are a smart as you think
you are and have the answer!

Sid.

"PFC Sadr" <pf******@hotmail.comwrote in message
news:11*********************@l53g2000cwa.googlegro ups.com...
CSV + 'BULK INSERT' = SQL Server

lose the training wheels; it doesn't make sense to reinvent the wheel


On Feb 21, 11:37 am, "Sid Price" <s...@nowhere.comwrote:
>Kerry,

The application does its data processing using a Dataset in many areas.
This
particular Dataset is built from an imported CSV rather than a database,
which is where many other Datasets come from. We do not want to duplicate
the functionality of our application to process this imported data, we
want
to use the code that already exists, i.e. the code that expects data
input
from a Dataset. It is not simply a matter of display.

Sid.

"Kerry Moorman" <KerryMoor...@discussions.microsoft.comwrote in message

news:68**********************************@microso ft.com...
Sid,
Why do you need to get the data into a new dataset/datatable?
Just use the filtered dataview for display, that's what it is for.
The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.
Kerry Moorman
"Sid Price" wrote:
>Robin,
>DataView.ToTable is not a defined method ... I am using VB.NET 2003.
>I don't see any way to get the filtered data from the DataView into my
new
Dataset.
>Sid.
>"RobinS" <Rob...@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.co m...
You can use a dataview of the table for display.
dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"
Then use the dataview to display.
You can also copy the dataview to a new table using dv.ToTable.
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <s...@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for
display
and
I can not find out how to do this. I have found methods for copying
a
Dataset but I can not see how to filter the rows copied using my
query.
>I hoped to be able to use a DataAdaptor to do this but
SelectCommand
requires a connection and I don't see how to create a connection to
my
Dataset object.
>Any pointers would be much appreciated.
Sid.
>(VB.NET 2003)- Hide quoted text -

- Show quoted text -


Feb 22 '07 #7
import it into a database and learn how to use a fucking where clause.

Datasets are for goddamn retards, if datareaders are faster and you're
not using them then you're not putting your customers first

On Feb 22, 6:31 am, "Sid Price" <s...@nowhere.comwrote:
Well that is truly an very informative message ... NOT.

Perhaps you could explain how changing the source of the data would would
help us achieve our goal when it is clear our problem is associated with
DataAdapter and DataSet objects. Maybe you really are a smart as you think
you are and have the answer!

Sid.

"PFC Sadr" <pfc_s...@hotmail.comwrote in message

news:11*********************@l53g2000cwa.googlegro ups.com...
CSV + 'BULK INSERT' = SQL Server
lose the training wheels; it doesn't make sense to reinvent the wheel
On Feb 21, 11:37 am, "Sid Price" <s...@nowhere.comwrote:
Kerry,
The application does its data processing using a Dataset in many areas.
This
particular Dataset is built from an imported CSV rather than a database,
which is where many other Datasets come from. We do not want to duplicate
the functionality of our application to process this imported data, we
want
to use the code that already exists, i.e. the code that expects data
input
from a Dataset. It is not simply a matter of display.
Sid.
"Kerry Moorman" <KerryMoor...@discussions.microsoft.comwrote in message
>news:68**********************************@microso ft.com...
Sid,
Why do you need to get the data into a new dataset/datatable?
Just use the filtered dataview for display, that's what it is for.
The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.
Kerry Moorman
"Sid Price" wrote:
Robin,
DataView.ToTable is not a defined method ... I am using VB.NET 2003.
I don't see any way to get the filtered data from the DataView into my
new
Dataset.
Sid.
"RobinS" <Rob...@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com ...
You can use a dataview of the table for display.
dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"
Then use the dataview to display.
You can also copy the dataview to a new table using dv.ToTable.
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <s...@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for
display
and
I can not find out how to do this. I have found methods for copying
a
Dataset but I can not see how to filter the rows copied using my
query.
I hoped to be able to use a DataAdaptor to do this but
SelectCommand
requires a connection and I don't see how to create a connection to
my
Dataset object.
Any pointers would be much appreciated.
Sid.
(VB.NET 2003)- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -

Feb 22 '07 #8
Well, can you filter it and then move the rows from one dataset to the
other one one-by-one? That's about all I can think of, the "brute force"
method.

Robin S.
----------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uF****************@TK2MSFTNGP04.phx.gbl...
Kerry,

The application does its data processing using a Dataset in many areas.
This particular Dataset is built from an imported CSV rather than a
database, which is where many other Datasets come from. We do not want to
duplicate the functionality of our application to process this imported
data, we want to use the code that already exists, i.e. the code that
expects data input from a Dataset. It is not simply a matter of display.

Sid.

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:68**********************************@microsof t.com...
>Sid,

Why do you need to get the data into a new dataset/datatable?

Just use the filtered dataview for display, that's what it is for.

The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.

Kerry Moorman
"Sid Price" wrote:
>>Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don't see any way to get the filtered data from the DataView into my
new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.co m...
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for display
and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my
query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to
my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)




Feb 23 '07 #9
Sid,

I just saw this post on another news group and thought it might apply to
what you are trying to do:

http://www.gotdotnet.com/Community/M...aspx?id=397449

Kerry Moorman
"Sid Price" wrote:
Kerry,

The application does its data processing using a Dataset in many areas. This
particular Dataset is built from an imported CSV rather than a database,
which is where many other Datasets come from. We do not want to duplicate
the functionality of our application to process this imported data, we want
to use the code that already exists, i.e. the code that expects data input
from a Dataset. It is not simply a matter of display.

Sid.

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:68**********************************@microsof t.com...
Sid,

Why do you need to get the data into a new dataset/datatable?

Just use the filtered dataview for display, that's what it is for.

The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.

Kerry Moorman
"Sid Price" wrote:
Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don't see any way to get the filtered data from the DataView into my
new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com. ..
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for display
and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don't see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)




Feb 23 '07 #10
This looks promising, thanks Kerry. I will be looking at this approach
later,
Sid.
"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...
Sid,

I just saw this post on another news group and thought it might apply to
what you are trying to do:

http://www.gotdotnet.com/Community/M...aspx?id=397449

Kerry Moorman
"Sid Price" wrote:
>Kerry,

The application does its data processing using a Dataset in many areas.
This
particular Dataset is built from an imported CSV rather than a database,
which is where many other Datasets come from. We do not want to duplicate
the functionality of our application to process this imported data, we
want
to use the code that already exists, i.e. the code that expects data
input
from a Dataset. It is not simply a matter of display.

Sid.

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:68**********************************@microso ft.com...
Sid,

Why do you need to get the data into a new dataset/datatable?

Just use the filtered dataview for display, that's what it is for.

The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.

Kerry Moorman
"Sid Price" wrote:

Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don't see any way to get the filtered data from the DataView into my
new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com ...
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for
display
and
I can not find out how to do this. I have found methods for copying
a
Dataset but I can not see how to filter the rows copied using my
query.

I hoped to be able to use a DataAdaptor to do this but
SelectCommand
requires a connection and I don't see how to create a connection to
my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)





Feb 23 '07 #11
Kerry,

Thank you so much for the link, it pointed me in the correct direction to a
resolution of my issue.

Sid.

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...
Sid,

I just saw this post on another news group and thought it might apply to
what you are trying to do:

http://www.gotdotnet.com/Community/M...aspx?id=397449

Kerry Moorman
"Sid Price" wrote:
>Kerry,

The application does its data processing using a Dataset in many areas.
This
particular Dataset is built from an imported CSV rather than a database,
which is where many other Datasets come from. We do not want to duplicate
the functionality of our application to process this imported data, we
want
to use the code that already exists, i.e. the code that expects data
input
from a Dataset. It is not simply a matter of display.

Sid.

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:68**********************************@microso ft.com...
Sid,

Why do you need to get the data into a new dataset/datatable?

Just use the filtered dataview for display, that's what it is for.

The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.

Kerry Moorman
"Sid Price" wrote:

Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don't see any way to get the filtered data from the DataView into my
new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com ...
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = 'USA'"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...
I have Dataset that I need to filter into another Dataset for
display
and
I can not find out how to do this. I have found methods for copying
a
Dataset but I can not see how to filter the rows copied using my
query.

I hoped to be able to use a DataAdaptor to do this but
SelectCommand
requires a connection and I don't see how to create a connection to
my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)





Feb 24 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by ramesh | last post: by
2 posts views Thread by Hugo Lefevre | last post: by
3 posts views Thread by crjunk | last post: by
2 posts views Thread by Parveen | last post: by
4 posts views Thread by gillcleeren | last post: by
reply views Thread by Derek Vincent | last post: by
1 post views Thread by WayneM | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.