HighTechTalks DotNet Forums  

Add a new column to dBase

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss Add a new column to dBase in the Dotnet Framework (ODBC.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Add a new column to dBase - 05-19-2004 , 02:19 PM






I have a database in data.dbf

Now, I want to add a new column to this datebase. I write it in C#.

My code is:

string nazwa = "dsn=baza_dbf";
OdbcConnection cn = new OdbcConnection(nazwa);
cn.Open();

OdbcCommand cmd = new OdbcCommand();

cmd.CommandText = "??????????????????????????????????????";
cmd.Connection = cn;
cmd.ExecuteNonQuery();

cn.Close();

What should I write in cmd.CommandText = ...

Please help

Reply With Quote
  #2  
Old   
Cindy Winegarden
 
Posts: n/a

Default Re: Add a new column to dBase - 05-19-2004 , 08:57 PM






In news: 21669c6c.0405191019.4f18ee49 (AT) po...OT) google.com,
smalolepszy <smalolepszy (AT) poczta (DOT) onet.pl> wrote:
Quote:
I have a database in data.dbf. Now, I want to add a new column to this
datebase. I write it in C#.

My code is:

string nazwa = "dsn=baza_dbf";
OdbcConnection cn = new OdbcConnection(nazwa);
cn.Open();

OdbcCommand cmd = new OdbcCommand();

cmd.CommandText = "??????????????????????????????????????";
Hi Smalolepszy,

I work with Visual FoxPro, not Dbase, but in VFP I would use something like:

Alter Table MyTable Add Column MyFieldname C(10)

Choices for field type most likely include:
Character: C(nNumOfChars)
Date: D
Numeric N(nLength, nDecimalPlaces)
Memo: M
Logical (Boolean): L

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden (AT) mvps (DOT) org www.cindywinegarden.com





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.