摘要:
MySQLConnectionconn=null; try{ //MySQLConnectionconn=newMySQLConnection(newMySQLConnectionString("myquest","root","amttgroup").AsString); //实例化一个连接对象其中myquest为数据库名,root为数据库用户名,amttgroup为数据库密码 stringconnstr="DataSource=MySQL;Password=root;UserID=root;Location=localh 阅读全文
摘要:
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;public partial class _Def 阅读全文
摘要:
MySqlConnection connection = new MySqlConnectio(connectionString); using (MySqlCommand cmd = new MySqlCommand(safeSql, connection)) { try { connection.Open(); return cmd.ExecuteNonQuery(); } catch (Exception ex) { connection.Close(); return 0; } } 阅读全文
摘要:
1、用MySQLDriverCS连接MySQL数据库先下载和安装MySQLDriverCS,地址:http://sourceforge.net/projects/mysqldrivercs/在安装文件夹下面找到MySQLDriver.dll,然后将MySQLDriver.dll添加引用到项目中注:我下载的是版本是 MySQLDriverCS-n-EasyQueryTools-4.0.1-DotNet2.0.exeusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data; 阅读全文