下面是commond:
MySQLCommand cmd;
cmd = new MySQLDriverCS.MySQLCommand("DROP TABLE IF EXISTS test.mysqldrivercs_test",conn);
cmd.ExecuteNonQuery();
cmd.Dispose();
下面是insert:
string Value = "Value";
int SettingID = 1;
new MySQLInsertCommand(conn,
new object[,] {{"SettingID",SettingID},{"SettingValue",Value}},
"mysqldrivercs_test");
下面是update
Value = "Value2";
new MySQLUpdateCommand(conn,
new object[,] {{"SettingValue",Value}},
"mysqldrivercs_test",
new object[,] {{"SettingID","=",SettingID}},
null);
下面是select
DataTable dt = new MySQLSelectCommand(conn,
new string[] {"SettingID","SettingValue"},
new string[] {"mysqldrivercs_test"},
new object[,] {{"SettingID","=",SettingID}},
null,
null
).Table;
string storedValue = dt.Rows[0]["SettingValue"].ToString();
下面是delete
new MySQLDeleteCommand(conn,"mysqldrivercs_test",new object[,] {{"SettingID","=",SettingID}},null);
关闭链接:
conn.Close();
mysql里最常用的日志有4种,分别是:错误日志,二进制日志,查询日志以及满查询日志. 1.错误日志会记录当mysql启动和关闭以及运行中的错误信息,可以使用 --log-error[=file_name]来指定错误日志存放文件.当mysql server异常的时候应该首先查看该日志.其实里面也没什么,我英语四级没过,配上词霸目前为止还没有碰到解决不了的问 ......