Monday, March 12, 2012

how to copy columns into other table

Hi.
I am look for a smart way to copy dataColumn's form one table to an other.
I try to copy all primary key columns to an other table as foreign key
columns.
-> dtNew.Columns.AddRange(dtOld.PrimaryKey) (pseudo example)
This of cause don't work because dtOld.PrimaryKey(0).Table contains
a reference to dtAlt dataTable.
Any Idea?
Greetings TomekHi Tomasz,
The datacolumn does (with execption from a 1 column table) not exist as
dataitem.
In my opinion you have to loop through your old table to copy it.
(And do not do it direct because than you are setting the references and the
values are still in the original).
Cor
Cor Ligthert wrote:
> Hi Tomasz,
> The datacolumn does (with execption from a 1 column table) not exist as
> dataitem.
> In my opinion you have to loop through your old table to copy it.
> (And do not do it direct because than you are setting the references and the
> values are still in the original).
> Cor
>
Hi Cor.
thanks for answer :)
I did it so.
*Tomek*

Labels: , , , , , , , , ,

how to convert dBase Database to Access-SQL Database in ASP.Net

I'm developing a project which the data is output from other application (windows application) in form of dBase Database (DBF), i need to convert it into an access/sql data by using asp.net so i can manipulate. please anyone tell me how.

Thank you.

ApcYou could use ADO.NET and the ODBC or OleDb providers (as appropriate - I do not know what the status of drivers for dBase is these days).

At that point, just read it in and write it out...
I use OleDBConnection with Microsoft OLE DB Provider for ODBC Drivers with this properties :
- Use data source name : dBASE Files
- Enter the initial catalog to use : "myprojectpath"

but then I encounter this error :

"The .Net Data OLE DB Provider(System.Data.OleDb) does not support the MSDASQL
Provider, Microsoft OLE DB Provider for ODBC Drivers."

Can you tell me how to solve this problem.

Thank you.
Use the .NET ODBC provider. Using .NET 1.1, the ODBC provider should already be installed. It has classes that mirror SqlClient and OleDb.

Labels: , , , , , , , , , , , , ,