tshock数据库
数据库操作:
①判断数据库类型
string query; if ((int)DbExt.GetSqlType(TShock.DB) == 1) {//sqlit} else {//mysql} TShock.DB.Query(query);
②读取SQL
string query = "select * from regions;"; QueryResult queryResult = TShock.DB.QueryReader(query); while(queryResult.Read()) { int x = queryResult.Get<int>("X1"); int y = queryResult.Get<int>("Y1"); }
③执行SQL
string query = "select * from regions;"; TShock.DB.Query();
扫描二维码推送至手机访问