473,388 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Create a datatable from a datatable

Hi

using vbnet
is it possible to create a datatable from another datatable using a select
query
So i have a datatable1 with all data

I need to create from datatable1 a new datatable2 select on datatable1

each datatable need to fill a datagridview

manny thanks in advance
Marc
Feb 2 '08 #1
6 1844
You could easy acomplish this with a dataview object

"Marc" <So******@coco.comschreef in bericht
news:uv**************@TK2MSFTNGP05.phx.gbl...
Hi

using vbnet
is it possible to create a datatable from another datatable using a select
query
So i have a datatable1 with all data

I need to create from datatable1 a new datatable2 select on datatable1

each datatable need to fill a datagridview

manny thanks in advance
Marc


Feb 2 '08 #2
need to do possible update in the datagridview (datatable2)!!

"Michel Posseth [MCP]" <MS**@posseth.comschreef in bericht
news:ee**************@TK2MSFTNGP03.phx.gbl...
You could easy acomplish this with a dataview object

"Marc" <So******@coco.comschreef in bericht
news:uv**************@TK2MSFTNGP05.phx.gbl...
>Hi

using vbnet
is it possible to create a datatable from another datatable using a
select query
So i have a datatable1 with all data

I need to create from datatable1 a new datatable2 select on datatable1

each datatable need to fill a datagridview

manny thanks in advance
Marc



Feb 2 '08 #3
Marc,

Get the rows you need in a dataview and then use the dataview's ToTable
method to create a new datatable from the rows in the dataview.

Kerry Moorman
"Marc" wrote:
need to do possible update in the datagridview (datatable2)!!

"Michel Posseth [MCP]" <MS**@posseth.comschreef in bericht
news:ee**************@TK2MSFTNGP03.phx.gbl...
You could easy acomplish this with a dataview object

"Marc" <So******@coco.comschreef in bericht
news:uv**************@TK2MSFTNGP05.phx.gbl...
Hi

using vbnet
is it possible to create a datatable from another datatable using a
select query
So i have a datatable1 with all data

I need to create from datatable1 a new datatable2 select on datatable1

each datatable need to fill a datagridview

manny thanks in advance
Marc



Feb 2 '08 #4
Marc,

Not with the select, that creates an array of datarows, however why would
you, you have two other possibilities.

the datatable.Clone (but probably you want a selection and then)

Use the dataview.ToTable(with a lot of overloaded possibilities to (in
versions after 2003) exactly select what you need)

Cor
using vbnet
is it possible to create a datatable from another datatable using a select
query
So i have a datatable1 with all data

I need to create from datatable1 a new datatable2 select on datatable1

each datatable need to fill a datagridview

manny thanks in advance
Marc

Feb 2 '08 #5
Marc,

"Marc" <So******@coco.comschreef in bericht
news:O7**************@TK2MSFTNGP04.phx.gbl...
need to do possible update in the datagridview (datatable2)!!
And?
"Michel Posseth [MCP]"
>You could easy acomplish this with a dataview object
Cor

Feb 2 '08 #6
Thanks for the possible solutions in yours replies,

Marc..


"Cor Ligthert[MVP]" <no************@planet.nlschreef in bericht
news:92**********************************@microsof t.com...
Marc,

Not with the select, that creates an array of datarows, however why would
you, you have two other possibilities.

the datatable.Clone (but probably you want a selection and then)

Use the dataview.ToTable(with a lot of overloaded possibilities to (in
versions after 2003) exactly select what you need)

Cor
>using vbnet
is it possible to create a datatable from another datatable using a
select query
So i have a datatable1 with all data

I need to create from datatable1 a new datatable2 select on datatable1

each datatable need to fill a datagridview

manny thanks in advance
Marc


Feb 2 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Elliott | last post by:
I can create this: ?xml version="1.0" standalone="yes" ?> <ConfigOpt> <record> <Field_1>Text # 1</Field_1> <Field_2>Text # 2</Field_2> </record> </ConfigOpt>
5
by: Mountain Bikn' Guy | last post by:
How would I do this? public sealed class UtilityClass { public static MyObject Object1;//see note below about importance of static object names in this class public static MyObject Object2;...
2
by: Jacob | last post by:
A simple question: I've read a couple of things that indicates I can create a new table in my database using some SQL command. Is this correct? I would like to load a database into a DataSet,...
2
by: Fredrik Rodin | last post by:
All, I've been looking around for a solution to my problem for a couple of days now. In short, here's my situation: 1. I'm getting a result from a component back as a datatable and I have...
1
by: jg | last post by:
I need to create a DataTable object, but I dont want to add columns programatically, the DataTable should have columns based on a Table in my SQL database. How can I create a DataTable with column...
12
by: Doug Bell | last post by:
Hi, I am having problems trying to create a (temporary) DataTable from a selection from a DataGrid (dgOrders). dtOrdDetails is declared as a Public DataTable Sub is: Dim stFilter as String...
4
by: mojeza | last post by:
I would like to create generic object which will be used for store of single row of DataTable. Lets say I create class as follow: Public Class Participant Public ParticipantID As Int64 Public...
13
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I want to create a new column in a datatable from two existing columns. I have no problem to create the new column using the datatable.columns.add method. The problem is the value of the new...
5
by: bz | last post by:
Hi, I create a class that retrieves a number of records from database. Internally, the class store the returned data in a datatable / datareader. I would like to bind a listbox to that class (to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.