.Net中操作MySql数据库
2007-11-11 13:43:00 来源:WEB开发网核心提示: Dim MyODBCConnexion As New OdbcConnection(MyConString) Try Dim ds As New DataSet() Dim cmd As OdbcDataAdapter = New OdbcDataAdapter(ReqSQL, MyConString)
Dim MyODBCConnexion As New OdbcConnection(MyConString)
Try
Dim ds As New DataSet()
Dim cmd As OdbcDataAdapter = New
OdbcDataAdapter(ReqSQL, MyConString)
Dim MyCommand As New OdbcCommand()
Dim MyDataReader As OdbcDataReader
cmd.Fill(ds, NomDataSet)
MyODBCConnexion.Close()
Return ds
Catch MyOdbcException As OdbcException
'
HttpContext.Current.Response.Write(MyOdbcException.ToString)
Catch MyException As Exception
'
HttpContext.Current.Response.Write(MyException.ToString)
End Try
End Function
//对函数的调用
Dim MonDatasetTemp As DataSet = MySQL(和PHP搭配之最佳组合)_Requettes.MyODBCDataset(
SQL,
constantes.ODBCBase,
constantes.ODBCServer,
constantes.ODBCPwd,
constantes.ODBCUser,
"MonDataset")
此程序用到的类库可在如下地址下载:http://www.codeproject.com/dotnet/MySQL(和PHP搭配之最佳组合)Connexion/MySQL(和PHP搭配之最佳组合)Connexion.zip
更多精彩
赞助商链接