Re: Adding a Column fro a DataTable to Another DataTable
- From: "Frank Hickman [MVP]" <fhickman3_NOSP@xxxxxxxxxxxxxxx>
- Date: Tue, 24 Jan 2006 00:28:23 -0500
"FredC" <FredC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B206C4F4-797B-49E5-B354-0D6D1EE2619F@xxxxxxxxxxxxxxxx
> I'm trying to build a new DataTable from the columns of other DataTables:
>
> DataTable myTable = new DataTable("theData");
>
> myTable.Columns.Add(DataSetTemp.Tables["10MinuteData"].Columns["Date"]);
>
> I get the error - Column 'Date' already belongs to another DataTable -
> I know that already - Whats stopping me from adding this column to new
> DataTable?
>
> Thxs.
Is this Access? Perhaps "Date" is a keyword for your database. If it is
Access try using brackets in the string, if it is another type database that
uses quoted identifiers try escaping some quotes in...
myTable.Columns.Add(DataSetTemp.Tables["10MinuteData"].Columns["[Date]"]);
myTable.Columns.Add(DataSetTemp.Tables["10MinuteData"].Columns["\"Date\""]);
--
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
.
- Prev by Date: Re: Newbie : Oracle data to Access table.
- Next by Date: Re: Permissions to allow creation of forms etc?
- Previous by thread: Newbie : Oracle data to Access table.
- Next by thread: Re: ADO Connection - Fails - Unspecified Error
- Index(es):
Relevant Pages
- Re: Dataset (ASP.net) has two datatables. is this normal?
... > Is it common to see two datatables within a dataset? ... > to "dbo"
and the other belongs to the user who will be accessing the page. ... > TIA, Randy
... Prev by Date: ... (microsoft.public.dotnet.framework.aspnet) - Re: Joins with Datatables
... but you can use a DataRelation between them and work with it that way as ...
> intention of being able to work of disconnected way (datatables, schema, ... Prev
by Date: ... (microsoft.public.dotnet.framework.adonet) - Re: Counting records in a dataset
... It's the datatables inside the datasets ... and have the results post to a textbox
(txtResult). ... Dim Command As Odbc.OdbcCommand = New Odbc.OdbcCommandFROM ...
Prev by Date: ... (microsoft.public.dotnet.languages.vb) - Re: DataTables
... > I have two DataTables with same schema ... aren't compatible rows
in the second table. ... Reporting tool: http://www.neodatatype.net ... Prev
by Date: ... (microsoft.public.dotnet.languages.csharp) - Re: Best practice for showing data from diferent queries in same form
... Can you cache them in memory as datatables then do a random selection?
... Prev by Date: ... (microsoft.public.dotnet.framework.aspnet)