Groups | Blog | Home
all groups > dotnet odbc.net > may 2004 >

dotnet odbc.net : Add a new column to dBase



smalolepszy NO[at]SPAM poczta.onet.pl
5/19/2004 11:19:16 AM
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 = ...

Cindy Winegarden
5/19/2004 8:57:29 PM
In news: 21669c6c.0405191019.4f18ee49@posting.google.com,
[quoted text, click to view]

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@mvps.org www.cindywinegarden.com


AddThis Social Bookmark Button