Search code examples
c#mysqlcreate-table

Help getting the following create table function to work with mysql and C#


string createTable = "CREATE TABLE IF NOT EXISTS " + m_strDatabase + "_TimeLogs (logName VARCHAR(16), logTime INTEGER, logCountry TEXT, UNIQUE(logName)) TYPE=MyISAM;";

When this runs, no table is created. No errors either.

Im using an ODBC connector.

the variable passes in the db name, so that the table created would be users_TimeLogs if the database was called users for example.

Am I doing something wrong?


Solution

  • I'd forgotten that way way above in my code I had a constraint to only run if a list.count > 0, and since I'm only testing at this stage the list was empty..