解决方案 »
- 将html、js代码过滤后,css代码怎么过滤?采集系统
- 请问这个图片切换效果是怎么做的
- (Microsoft.Office.Interop.Excel.Sheets)excel.ActiveWorkbook.Sheets.Count???
- 从网上收集的一些源代码,电子教程和视频讲座(还有VIP视频哦)
- 问几个基础问题..望详解
- 请大家帮个忙!!!!
- 请问怎么把从数据库中读出来的内容变成没有HtmlEncode功能的字符串。用Server.怎么不行??
- asp.net中怎么将浏览过的页面,形成快捷菜单
- 最近需要写一些技术文档和项目总结,请大家给点参考文献,多谢!!!
- 水晶报表公式中的字段名称支持动态的吗?
- 网站的本地化
- ACCESS的查询语句问题
try
{
string connstr = "Data Source=MySQL;Password=root;User ID=root;Location=localhost";
conn = new MySQLConnection(constr);
conn.Open();
string query = "insert into test.dbtable values(10, 'disksidkfsdi', 'asdfaf', 'adsfasdf')";
string tmp = null;
MySQLCommand cmd = new MySQLCommand(query, conn);
for(int i = 0; i < 100000; i++)
{
cmd.ExecuteNonQuery();
}
cmd.Dispose();
conn.Close();
query = "select * from test.dbtable";
MySQLCommand cmd2 = new MySQLCommand(query, conn);
conn.Open();
MySQLDataReader reader = cmd2.ExecuteReaderEx();
while(reader.Read())
{
tmp = reader[0].ToString();
tmp = reader[1].ToString();
tmp = reader[2].ToString();
tmp = reader[3].ToString();
}
conn.Close();
query = "delete from test.dbtable";
MySQLCommand cmd3 = new MySQLCommand(query, conn);
conn.Open();
cmd3.ExecuteNonQuery();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
conn.Close();
}