SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 14th, 2003, 02:37 PM
IcoolerthnU IcoolerthnU is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: New Jersey, USA
Posts: 3 IcoolerthnU User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to IcoolerthnU Send a message via Yahoo to IcoolerthnU
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;UID= 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

Viewing: ASP Free ForumsDatabaseSQL Development > MyOLEDB connection problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT