G
Guest
I'm new to ADO.net so forgive me if this question seems obvious . . .
I want to programmatically create a table in an MS Access database. To do
this, I've implemented this code:
conn.Open();
string cmdText = "CREATE TABLE Respondents ([Index] Int
Primary Key, PollsterName Char(25), [Guid] Char(36), " +
"TimeCaptured Date, FirstName Char(25),
LastName Char(25), Address Char(75), City Char(30), " +
"StateProv Char(20), PostalCode Char(15),
AreaCode Char(5), TelNum Char(20), Sex Char(10), Age Byte)";
System.Data.OleDb.OleDbCommand cmd = new
System.Data.OleDb.OleDbCommand(cmdText, conn);
cmd.ExecuteNonQuery();
conn.Close();
But I'm wondering if there's a more object-oriented way to accomplish the
same thing?
I want to programmatically create a table in an MS Access database. To do
this, I've implemented this code:
conn.Open();
string cmdText = "CREATE TABLE Respondents ([Index] Int
Primary Key, PollsterName Char(25), [Guid] Char(36), " +
"TimeCaptured Date, FirstName Char(25),
LastName Char(25), Address Char(75), City Char(30), " +
"StateProv Char(20), PostalCode Char(15),
AreaCode Char(5), TelNum Char(20), Sex Char(10), Age Byte)";
System.Data.OleDb.OleDbCommand cmd = new
System.Data.OleDb.OleDbCommand(cmdText, conn);
cmd.ExecuteNonQuery();
conn.Close();
But I'm wondering if there's a more object-oriented way to accomplish the
same thing?