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

C#连接MySql数据库方法 宇兰

1、用MySQLDriverCS连接MySQL数据库
先下载和安装MySQLDriverCS,地址:http://sourceforge.net/projects/mysqldrivercs/在安装文件夹下面找到MySQLDriver.dll,然后将MySQLDriver.dll添加引用到项目中注:我下载的是版本是 MySQLDriverCS-n-EasyQueryTools-4.0.1-DotNet2.0.exe using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.Odbc;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using MySQLDriverCS;  namespace mysql{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }         private void Form1_Load(object sender, EventArgs e)        {             MySQLConnection conn = null;            conn = new MySQLConnection(new MySQLConnectionString("localhost", "inv", "root", "831025").AsString);            conn.Open();             MySQLCommand commn = new MySQLCommand("set names gb2312", conn);            commn.ExecuteNonQuery();             string sql = "select * from exchange ";            MySQLDataAdapter mda = new MySQLDataAdapter(sql, conn);             DataSet ds = new DataSet();            mda.Fill(ds, "table1");      &n


相关文档:

C#生成XML文件的 函数

protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
         &nbs ......

mysql alter 语句用法,添加、修改、删除字段等

http://www.blogjava.net/Alpha/archive/2007/07/23/131912.html
//主键549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//增加一个新列549830479
alter table t2 add d timestamp;
alter table infos add ex tinyint n ......

MySQL性能优化

作者:andyao
原文link: http://andyao.javaeye.com/admin/show/144033
转载请留名
1. 简介
在Web应用程序体系架构中,数据持久层(通常是一个关系数据库)是关键的核心部分,它对系统的性能有非常重要的影响。MySQL是目前使用最多的开源数据库,但是MySQL数据库的默认设置性能非常的差,仅仅是一个玩具数据库。因此在 ......

mysql 使用相关 持续更新中...

mysql停止命令
bin/mysqladmin -uroot -p shutdown
mysql启动命令
bin/mysqld_safe &
mysql 修改root密码
1.停止mysql服务
2.启动mysql服务时附加参数
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3.以root进入mysql
mysql -u root mysql
4.执行sql语句
mysql> UPDATE user S ......

VC用MYSQL提供的LIB查询数据库

#include "winsock.h"
#include "mysql.h"
void query_example(void)
{
MYSQL *pDbCon = NULL;
char *pszHost = "localhost";
char *pszUser = "guest";
char *pszPsw = "";
char *pszDbName = "mysql_db_name";
int iPort = 3306;
pDbCon = mysql_init((MYSQL*) 0);
if (NULL != pDbCon)
{ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号