Karl Tarbet
11/4/2002 8:34:00 PM
Hello:
I'm using the CREATE TABLE sql command with odbc dbase
driver (*.dbf).
How do I create a integer column?
My test below creates a double, in the first column,
instead of integer.
Thanks for any help
--------------
Karl
string sql = "CREATE TABLE test"+
" (myInt int, myFloat float, myString Char(32))";
// I even tried short -- but still get double.
string strAccessConn = @"Driver={Microsoft dBase Driver
(*.dbf)};DBQ=C:\";
OdbcConnection myConnection = new OdbcConnection
(strAccessConn);
myConnection.Open();
OdbcCommand myCommand = new OdbcCommand();
myCommand.Connection = myConnection;
try
{
myCommand.CommandText = sql;
myCommand.ExecuteNonQuery();
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
throw e;
}
finally
{
myConnection.Close();
}