I have this bit of code here:
This code does create a new table in the database. I can use another SQL command to write data to it, for example. The problem: this table is not persistent; it doesn't show up in the database, and closing/restarting the IDE (Visual Studio 2008) removes the table completely. The documentation suggests that it's supposed to be auto-commit by default, and I haven't set it to be otherwise.My code wrote: conn = new SqlCeConnection();
string connStr = Properties.Settings.Default.Database1ConnectionString;
conn.ConnectionString = connStr;
conn.Open();
SqlCeCommand cmd = new SqlCeCommand();
cmd.Connection = conn;
cmd.CommandText =
"CREATE TABLE ["+nextSeason+"TeamAssignment] ([TeamNumber] tinyint CONSTRAINT PK_TeamNumber PRIMARY KEY," +
" [TeamLetter] nvarchar(1) NOT NULL UNIQUE)";
cmd.ExecuteNonQuery();
conn.Close();
Anyone have any thoughts that they'd like to share? This is for a schedule-generation application I'm making for my softball league; it needs to create tables programmatically (sp?), which is why it's, you know, in the program.