If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MyOLEDB connection problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-14-03, 14:13
IcoolerthnU IcoolerthnU is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
Red face MyOLEDB connection problem

Heres some information about my setup:

- .net framework 1.1 sdk installed
- Microsoft MDAC 2.7 installed
- Microsoft odbc.net provider installed
- Mysql Servers and Clients install (this is the acctual server) installed
- MySQL Connector/ODBC driver installed
- setup odbc DSN for my database called "mysql_praxis"
- MyOLEDB provider (myoledb3.exe) installed

ok, i have been able to successfully connect to the database using ODBC by copying the ODBC.NET dll into the bin directory and using the microsoft.data.odbc namespace. What i cannot do is connec to the database using OLEDB. I installed the OLEDB provider and copied the Myprov.dll into the bin directory of my application. My code looks as follows:

<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<html>
<head>
<title>Praxis OLEDB test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="main.css" rel="stylesheet" type="text/css">

<Script language="C#" runat="server">
void Page_Load()
{
String strConnection, strSQL, strPath;
OleDbDataReader objDataReader = null;

strConnection = @"Provider=MySqlProv;SERVER=127.0.0.1;DB=praxis;UI D=praxisadmin;PWD=1118";
strSQL = "select * from user";
OleDbConnection objConnection = new OleDbConnection(strConnection); // Connect
OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection); // Prepare command

objConnection.Open();
objDataReader = objCommand.ExecuteReader();

if (objDataReader.Read() == true){
welcomeLabel.Text = "Username = " + objDataReader["username"] + ", Password = " +
objDataReader["password"] + ", firstName = " + objDataReader["firstName"] +
", lastName = " + objDataReader["lastName"] + "!";
}
objDataReader.Close();
objConnection.Close();
}
</Script>

</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<asp:Label ID="welcomeLabel" ToolTip="Enter Your Password" runat="server" ForeColor="#0000CC" f/>
</div>
</body>
</html>

When i attept to load this page nothing happens, no errors, it just never loads. It says "waiting for localhost" and nothing ever loads. Somebody help!

-Thanks in advance
Cooler
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On