易截截图软件、单文件、免安装、纯绿色、仅160KB

在C#.net程序中使用MYSQL数据库

下面是commond:
MySQLCommand cmd;
cmd = new MySQLDriverCS.MySQLCommand("DROP TABLE IF EXISTS test.mysqldrivercs_test",conn);
cmd.ExecuteNonQuery();
cmd.Dispose();
下面是insert:
string Value = "Value";
int SettingID = 1;
new MySQLInsertCommand(conn,
new object[,] {{"SettingID",SettingID},{"SettingValue",Value}},
"mysqldrivercs_test");
下面是update
Value = "Value2";
new MySQLUpdateCommand(conn,
new object[,] {{"SettingValue",Value}},
"mysqldrivercs_test",
new object[,] {{"SettingID","=",SettingID}},
null);
下面是select
DataTable dt = new MySQLSelectCommand(conn,
new string[] {"SettingID","SettingValue"},
new string[] {"mysqldrivercs_test"},
new object[,] {{"SettingID","=",SettingID}},
null,
null
).Table;
string storedValue = dt.Rows[0]["SettingValue"].ToString();
下面是delete
new MySQLDeleteCommand(conn,"mysqldrivercs_test",new object[,] {{"SettingID","=",SettingID}},null);
关闭链接:
conn.Close();


相关文档:

如何修改MYSQL数据库里的用户名密码

windows2003----开始----运行---mysql -uroot -p,进入MYSQL数据库,输入密码,登陆。
show databases;看看有哪些数据库
use xxxxxx;(xxxxxx为数据库名,进入数据库)
update user set passwd=MD5('111111*') where user_name = 'admin';(111111为要修改的密码) ......

MySQL数据库操作中文乱码

解决乱码最好的方法是在项目设计之初,统一所有的字符集,例如页面、request对象以及数据库等等。
一、 几种常见的乱码现象:
1、页面乱码
    单纯的页面乱码是很好解决的,只要修改头部适合的字符集即可,如果页面中文显示乱码,你可以把字符集修改为:gb2312或gbk。
2、页面之间传递的参数是乱码 ......

mysql 学习手记(1)

1.设置变量
    set @x = 2;
    或:
    select @x := max(fields) as max from table;
2.生成html或xml
    mysql -H -uroot -p databaseName        生成html文件
    mysql -x -uroot -p databaseNam ......

利用MySQLDriverCS实现在.NET环境下访问MySQL数据库

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MySQLDriverCS;
&nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号