Modifying table structure programmatically

  • Thread starter Thread starter Alexei Adadurov
  • Start date Start date
A

Alexei Adadurov

Hello all!
I'm new to ADO.NET and I have 2 questions:

1. I need to programmatically create a copy of a table (say, 'table1'),
named something like 'table1_copy', containing only the structure of the
source table and no data.
I tried to use System.Data.DataTable.Clone() to create a copy of a
table, but couldn't get it saved into the DB. Is there any way to do that?

2. I need to modify the structure of a table (e.g. create couple of new
fields). I can add objects to the Columns collection of
System.Data.DataTable object, but, again, cannot save changes into the
database.
What's the correct way to do that?

Thanks in advance,
Alexei N. Adadurov.
alexei.adadurov[at]mail.ru

Have anybody tried to create a copy of a table in a Microsoft Access
database
 

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

Back
Top