Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: help with mysql databases and aspx


Message #1 by "Lyle Ologsis" <hadj_hadj@h...> on Tue, 16 Oct 2001 02:34:44 +0200
Hi,



I'm having trouble with accessing a mysql database running on my IIS5/Win2k 

server from within an .aspx page. Nothing I tried seems to work. The old asp 

way of connecting via a dsn like



myConn = "dsn=localConn;uid=anon;pwd=topSECRET;"

set rsTest = Server.CreateObject("ADODB.Recordset")

rsTest.ActiveConnection = myConn

rsTest.Source = "SELECT * FROM myTable"



obviously isn't applicable anymore.



Does anyone have an idea on how to do this ? Not being able to access my 

mysql db from asp .net pages is lessening my fun with asp.net. Am I missing 

something stupid or is this just not possible ?



Thanks



Hadj

Message #2 by Todd Carrico <ToddC@m...> on Mon, 15 Oct 2001 20:31:59 -0500
Well, I have not tried it with MySQL, but I don't why it can't done.



There are three Managed Providers for .NET.  A Managed provider can be

thought of as a driver in the ODBC world, but it is really much more.



For starters, there is the System.Data.OleDb namespace, also known as the

OleDb managed provider. This namespace makes use of OleDb drivers that could

have been used with Classic ADO.



There is also the System.Data.SqlClient namespace, also known as the SQL

Server managed provider. This namespace is written specifically for SQL

Server, and doesn't work for anything but SQL 7.0, and up.



Microsoft has also made available the System.Data.Odbc namespace. This

namespace makes use of standard ODBC drivers, and this is where I think you

should start, if MySQL does not have an OleDb driver. This also works with

DSN's.



It can be found at:

http://www.microsoft.com/downloads/release.asp?ReleaseID=31125



It does come with a decent help file, with some examples. It installs fine,

and even hooks itself into the Global Assembly Cache during setup.



I have seen some peculiarities on the list, so I know people are using the

namespace.  I don't use it so I may not be much help with the specifics, but

this should get you started.



Good luck!



tc





-----Original Message-----

From: Lyle Ologsis [mailto:hadj_hadj@h...] 

Sent: Monday, October 15, 2001 7:35 PM

To: ASP+

Subject: [aspx] help with mysql databases and aspx



Hi,



I'm having trouble with accessing a mysql database running on my IIS5/Win2k 

server from within an .aspx page. Nothing I tried seems to work. The old asp



way of connecting via a dsn like



myConn = "dsn=localConn;uid=anon;pwd=topSECRET;"

set rsTest = Server.CreateObject("ADODB.Recordset")

rsTest.ActiveConnection = myConn

rsTest.Source = "SELECT * FROM myTable"



obviously isn't applicable anymore.



Does anyone have an idea on how to do this ? Not being able to access my 

mysql db from asp .net pages is lessening my fun with asp.net. Am I missing 

something stupid or is this just not possible ?



Thanks



Hadj
Message #3 by "Hadj Ullelah" <hadj_hadj@h...> on Tue, 16 Oct 2001 03:23:04
Thank you, I got it working now. The odbc namespace from microsoft was 

indeed the answer, it did everything you said it would.



Great :)



> Well, I have not tried it with MySQL, but I don't why it can't done.

> 

> There are three Managed Providers for .NET.  A Managed provider can be

> thought of as a driver in the ODBC world, but it is really much more.

> 

> For starters, there is the System.Data.OleDb namespace, also known as the

> OleDb managed provider. This namespace makes use of OleDb drivers that 

could

> have been used with Classic ADO.

> 

> There is also the System.Data.SqlClient namespace, also known as the SQL

> Server managed provider. This namespace is written specifically for SQL

> Server, and doesn't work for anything but SQL 7.0, and up.

> 

> Microsoft has also made available the System.Data.Odbc namespace. This

> namespace makes use of standard ODBC drivers, and this is where I think 

you

> should start, if MySQL does not have an OleDb driver. This also works 

with

> DSN's.

> 

> It can be found at:

> http://www.microsoft.com/downloads/release.asp?ReleaseID=31125

> 

> It does come with a decent help file, with some examples. It installs 

fine,

> and even hooks itself into the Global Assembly Cache during setup.

> 

> I have seen some peculiarities on the list, so I know people are using 

the

> namespace.  I don't use it so I may not be much help with the specifics, 

but

> this should get you started.

> 

> Good luck!

> 

> tc

> 

> 

> -----Original Message-----

> From: Lyle Ologsis [mailto:hadj_hadj@h...] 

> Sent: Monday, October 15, 2001 7:35 PM

> To: ASP+

> Subject: [aspx] help with mysql databases and aspx

> 

> Hi,

> 

> I'm having trouble with accessing a mysql database running on my 

IIS5/Win2k 

> server from within an .aspx page. Nothing I tried seems to work. The old 

asp

> 

> way of connecting via a dsn like

> 

> myConn = "dsn=localConn;uid=anon;pwd=topSECRET;"

> set rsTest = Server.CreateObject("ADODB.Recordset")

> rsTest.ActiveConnection = myConn

> rsTest.Source = "SELECT * FROM myTable"

> 

> obviously isn't applicable anymore.

> 

> Does anyone have an idea on how to do this ? Not being able to access my 

> mysql db from asp .net pages is lessening my fun with asp.net. Am I 

missing 

> something stupid or is this just not possible ?

> 

> Thanks

> 

> Hadj

  Return to Index