56,677
社区成员
发帖
与我相关
我的任务
分享
CREATE TABLE `t_msghis` (
`Serial` varchar(255) NOT NULL,
`Type` int(11) DEFAULT NULL,
`Title` varchar(255) DEFAULT NULL,
`Context` varchar(255) DEFAULT NULL,
`OperTime` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
MySQLConnection conn;
conn = new MySQLConnection(connectionstring);
conn.Open();
MySQLCommand commn = new MySQLCommand("set names gb2312", conn);
commn.ExecuteNonQuery();
string sql = "select * from t_msghis";
MySQLDataAdapter mda = new MySQLDataAdapter(sql, conn);
mda.Fill(table);
conn.Close();
return table;
public int ExecuteCmd(string str)
{
MySQLConnection conn;
conn = new MySQLConnection(connectionstring);
conn.Open();
MySQLCommand commn = new MySQLCommand("set names gb2312", conn);
commn.ExecuteNonQuery();
commn = new MySQLCommand(string.Format("update t_msghis set context='{0}'", str), conn);
int icmd = commn.ExecuteNonQuery();
return icmd;
}