使用select count(*) from role where id = 1
可以提取除数据
但是用
select count(*) from role where name = '王明'
有这个数据但是读不出来using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using MySql.Data;
using MySql.Data.MySqlClient; private void btnScreach_Click(object sender, EventArgs e)
{
string sql = "select count(*) from role where name='狂'";
MySqlCommand command = new MySqlCommand(sql, DBhelp.connection);
DBhelp.connection.Open();
int count = Convert.ToInt32(command.ExecuteScalar());
}dll地址
http://mysql.isu.edu.tw/Downloads/Connector-Net/?dir=/Unix/Database/MySQL/Downloads/Connector-Net&page=3
高手给个提示,那里的问题
解决方案 »
- C# LISTBOX显示的问题
- 用C#做DLL,求调试方法
- c#创建的服务在win2008下无法启动
- 关于try的疑问
- 自定义控件集合属性的问题.
- winform程序,为什么datagrid重新邦定后,画面上依旧显示上次鼠标单击过的单元格的内容?恳请帮忙。
- 送大家一段用GDI+画如Windows画图里画虚线矩形选框的代码
- dev navbarcontrol 控件里的 configura button怎么去掉
- 大家新年好!!!
- 求助:并发冲突
- winform中的日历控件如何与TextBox结合使用,当我在TextBox获取焦点时弹出日历控件,要把在日历控件范围内的其他控件遮挡起来
- C#的开源ORM(MiniORM),希望你的拍砖。。。300分和源码迎接你
参考
http://www.cnblogs.com/nokiaguy/articles/1206469.html