1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| try
{
SqlCeEngine MySqlCeEngine = new SqlCeEngine("data source=C:/AAA.sdf");
MySqlCeEngine.CreateDatabase();
SqlCeConnection MySqlCeConnection = new SqlCeConnection("data source=c:/AAA.sdf");
MySqlCeEngine.Dispose();
MySqlCeConnection.Open();
SqlCeCommand MySqlCeCommand;
MySqlCeCommand = MySqlCeConnection.CreateCommand();
MySqlCeCommand.CommandType = System.Data.CommandType.Text;
MySqlCeCommand.CommandText = "create table tournee (tou_id int primary key, tou_code nvarchar(100)"
+ "create table agent (age_id int primary key )";
MySqlCeCommand.ExecuteNonQuery();
}
catch (Exception ex)
{
listBox1.Items.Add(ex.Message);
} |
Partager