在MonoDevelop中使用DBLinq 访问mysql数据库需要引用如下dll库:
System.Core.dll
DbLinq.dll
System.Data.Linq.dll
DbLinq.MySql.dll
MySql.Data.dll
System.Data.dll
using Systemusing System.Collections.Generic
using System.Web
using System.Web.UI
using DbLinq.MySql
using mysqllinq
using System.Data
using System.Linq
using DbLinq.Factory
using DbLinq.Logging
using MySql.Data.MySqlClient
namespace webloadmysql
{
public partial class Default : System.Web.UI.Page
{
private static mysqllinq.Test testdb
protected void Page_Load(object sender,EventArgs args)
{
if(testdb==null)
{
button1.Text = "初始化:testdb"
testdb=new mysqllinq.Test(new MySqlConnection( "server=localhostuser id=youruser password=yourpwd database=yourdb"))
}
else
{
button1.Text = "已存在:testdb"
}
}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)