j-w-thomas
asked on
Changing from ODBC connections to MySQL connector/NET
Question: Currently I use the following items for db connections, but I have had to change to MySQL Connector/Net and of course i need the new versions of the following:
This is how I normally make the declarations:
Dim objConn As New OdbcConnection(Configurati onSettings .AppSettin gs("DSN"))
Dim objCmd As OdbcCommand
Dim objRdr As OdbcDataReader
Dim objDA As OdbcDataAdapter
Dim objDS As New DataSet()
Are the new versions:
Dim objConn As New SqlConnection(Configuratio nSettings. AppSetting s("DSN2")) 'defined in web.config
Dim objRdr As SqlDataReader
Dim objCmd As SqlCommand
Dim objDA As SqlDataReader
are these correct?
If I add parameters is it still
objCmd.Parameters.Add("tes t",strTest )
Thanks
This is how I normally make the declarations:
Dim objConn As New OdbcConnection(Configurati
Dim objCmd As OdbcCommand
Dim objRdr As OdbcDataReader
Dim objDA As OdbcDataAdapter
Dim objDS As New DataSet()
Are the new versions:
Dim objConn As New SqlConnection(Configuratio
Dim objRdr As SqlDataReader
Dim objCmd As SqlCommand
Dim objDA As SqlDataReader
are these correct?
If I add parameters is it still
objCmd.Parameters.Add("tes
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is my web.config. It works fine with ODBC
<appSettings>
<add key="DSN2" value="Server=localhost;Da tabase=myd b;UID=root ;Password= 123;" />
</appSettings>
<appSettings>
<add key="DSN2" value="Server=localhost;Da
</appSettings>
ASKER
This is to connect to a MySQL db just to confirm as well
ASKER
no follow up from expert after first entry, but I still needed help
ASKER
Message A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)