易截截图软件、单文件、免安装、纯绿色、仅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密码忘记的修改方法

1、在linux下:
     查看mysql 是否运行:ps -ef | grep myslq
     如果 MySQL 正在运行,首先杀之: kill mysql的进程号。
  启动 MySQL :/usr/bin/safe_mysqld --skip-grant-tables &
  就可以不需要密码就进入 MySQL 了。
  然后就是
  >use mysql
   ......

MySQL数据库的基本操作命令

一、mysql服务操作
1、net start mysql //启动mysql服务
2、net stop mysql //停止mysql服务 
3、mysql -h主机地址 -u用户名 -p用户密码 //进入mysql数据库
4、quit //退出mysql操作
5、mysqladmin -u用户名 -p旧密码 password 新密码 //更改密码
6、grant select on 数据库.* to 用户名@登录主机 identifie ......

mysql connect by c++

#include <stdio.h>
#include <windows.h>
#include <mysql.h>
#define host "localhost"
#define username "root"
#define password "123"
#define database "oa"
MYSQL *conn;
int main()
{
MYSQL_RES *res_set;
MYSQL_ROW row;
unsigned int i,ret;
FILE *fp;
MYSQL_FIELD *field; ......

Mysql中如何批量生成脚本


[root@sql21 ~]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.1.26-rc-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database  &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号