public static bool CheckTable(string tableName) { string sql = SQL_SELECT_TABLE_EXISTS.Replace("@tableName", DBHelper.GetRealTable("TalkContent", tableName)); int drow = ServiceDBHelper.GetScaleSql(sql); return(drow == 0 ? false : true); }
/// <summary> /// 用户订购获取代码时生成一张表 /// </summary> /// <param name="nickNo">加密后的</param> public void CreateTable(string nickNo) { string sql = SQL_SELECT_TABLE_EXISTS.Replace("@tableName", DBHelper.GetRealTable("TalkContent", nickNo)); int drow = ServiceDBHelper.GetScaleSql(sql); if (drow == 0) { sql = SQL_CREATE_TABLE.Replace("@tableName", DBHelper.GetRealTable("TalkContent", nickNo)).Replace("@pk", "PK_TalkContent_" + nickNo); ServiceDBHelper.ExcuteSql(sql); } }