- 軟件大?。?span>6.04M
- 軟件語言:中文
- 軟件類型:國產(chǎn)軟件
- 軟件類別:免費(fèi)軟件 / 編程輔助
- 更新時(shí)間:2016-12-21 15:18
- 運(yùn)行環(huán)境:WinAll, WinXP, Win7, Win8
- 軟件等級(jí):
- 軟件廠商:
- 官方網(wǎng)站:暫無
5KB/中文/10.0
178KB/中文/10.0
618KB/中文/8.3
201KB/中文/10.0
12KB/中文/10.0
mysql.data.dll是為了使用unity編程用戶實(shí)現(xiàn)與mysql數(shù)據(jù)庫連接的驅(qū)動(dòng)文件,是完成數(shù)據(jù)庫連接的必要插件!本合集內(nèi)包含32位以及64位所有版本的mysql.data.dll!
使用mysql.data.dll將能夠使c#語音更加的簡(jiǎn)潔操作mysql數(shù)據(jù)庫,如果遇到丟失mysql.data.dll”或“無法找到mysql.data.dll”等錯(cuò)誤問題,即可下載插件進(jìn)行修復(fù)!
dll文件修復(fù)方法:
1、解壓下載的文件。
2、復(fù)制文件“mysql.data.dll”到系統(tǒng)目錄下。
3、系統(tǒng)目錄一般為:C:\WINNT\System32 64位系統(tǒng)為C:\Windows\SysWOW64
4、最后點(diǎn)擊開始菜單-->運(yùn)行-->輸入regsvr32 mysql.data.dll 后,回車即可解決錯(cuò)誤提示!
5.MySQL數(shù)據(jù)庫操作的C#代碼,需添加MySql.Data.dll的引用。
MySql.Data.dll引用文件:
/// <summary>
/// MySQL數(shù)據(jù)庫操作
/// author:hhm
/// date:2012-2-22
/// </summary>
public class MySqlDbHelper
{
#region 私有變量
private const string defaultConfigKeyName = "DbHelper";//連接字符串 默認(rèn)Key
private string connectionString;
private string providerName;
#endregion
#region 構(gòu)造函數(shù)
/// <summary>
/// 默認(rèn)構(gòu)造函數(shù)(DbHelper)
/// </summary>
public MySqlDbHelper()
{
this.connectionString = ConfigurationManager.ConnectionStrings["DbHelper"].ConnectionString;
this.providerName = ConfigurationManager.ConnectionStrings["DbHelper"].ProviderName;
}
/// <summary>
/// DbHelper構(gòu)造函數(shù)
/// </summary>
/// <param name="keyName">連接字符串名</param>
public MySqlDbHelper(string keyName)
{
this.connectionString = ConfigurationManager.ConnectionStrings[keyName].ConnectionString;
this.providerName = ConfigurationManager.ConnectionStrings[keyName].ProviderName;
}
#endregion
public int ExecuteNonQuery(string sql, params MySqlParameter[] parameters) {
MySqlConnection con = new MySqlConnection(connectionString);
con.Open();
MySqlCommand cmd = new MySqlCommand(sql, con);
foreach (MySqlParameter parameter in parameters)
{
cmd.Parameters.Add(parameter);
}
int res =0;
try
{
res = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
res = -1;
}
cmd.Dispose();
con.Close();
return res;
}
public object ExecuteScalar(string sql, params MySqlParameter[] parameters)
{
MySqlConnection con = new MySqlConnection(connectionString);
con.Open();
MySqlCommand cmd = new MySqlCommand(sql, con);
foreach (MySqlParameter parameter in parameters)
{
cmd.Parameters.Add(parameter);
}
object res = cmd.ExecuteScalar();
cmd.Dispose();
con.Close();
return res;
}
public DataTable ExecuteDataTable(string sql, params MySqlParameter[] parameters)
{
MySqlConnection con = new MySqlConnection(connectionString);
con.Open();
MySqlCommand cmd = new MySqlCommand(sql, con);
foreach (MySqlParameter parameter in parameters)
{
cmd.Parameters.Add(parameter);
}
DataSet dataset = new DataSet();//dataset放執(zhí)行后的數(shù)據(jù)集合
MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
adapter.Fill(dataset);
cmd.Dispose();
con.Close();
return dataset.Tables[0];
}
}
解壓密碼:www.dineoutnj.com
請(qǐng)描述您所遇到的錯(cuò)誤,我們將盡快予以修正,謝謝!
*必填項(xiàng),請(qǐng)輸入內(nèi)容