|
 |
aspx thread: Connect to MySQL database
Message #1 by "Zach Clements" <clementz@c...> on Wed, 27 Mar 2002 19:38:27
|
|
Could someone show me how to connect to a MySql database with ASP.net?
Thanks
Zach
Message #2 by "Harish" <harish@h...> on Thu, 28 Mar 2002 09:23:11 -0600
|
|
Zach,
Add these lines to your Web.Config file:
<appSettings>
<add key="ConnectionString"
value="server=MyServer;uid=MyUser;pwd=MyPassword;database=MyDatabase"/>
<add key="OLEDBConnectionString"
value="server=MyServer;uid=MyUser;pwd=MyPassword;database=MyDatabase;Provide
r=SQLOLEDB"/>
</appSettings>
And add these lines to connect to database:
Dim objConnection As SQLConnection
'**** Connect to SQL Server databases above 7.0
objConnection = new
SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
'**** Connect to other databases
objConnection = new
SqlConnection(ConfigurationSettings.AppSettings("OLEDBConnectionString"))
objConnection.OPen()
Harish.
-----Original Message-----
From: Zach Clements [mailto:clementz@c...]
Sent: Wednesday, March 27, 2002 7:38 PM
To: ASP+
Subject: [aspx] Connect to MySQL database
Could someone show me how to connect to a MySql database with ASP.net?
Thanks
Zach
Message #3 by "Zach Clements" <clementz@c...> on Fri, 29 Mar 2002 07:05:05 -0800
|
|
Thanks for you help!
Zach
----- Original Message -----
From: "Harish" <harish@h...>
To: "ASP+" <aspx@p...>
Sent: Thursday, March 28, 2002 7:23 AM
Subject: [aspx] RE: Connect to MySQL database
> Zach,
>
> Add these lines to your Web.Config file:
> <appSettings>
> <add key="ConnectionString"
> value="server=MyServer;uid=MyUser;pwd=MyPassword;database=MyDatabase"/>
> <add key="OLEDBConnectionString"
>
value="server=MyServer;uid=MyUser;pwd=MyPassword;database=MyDatabase;Provide
> r=SQLOLEDB"/>
> </appSettings>
>
> And add these lines to connect to database:
> Dim objConnection As SQLConnection
>
> '**** Connect to SQL Server databases above 7.0
> objConnection = new
> SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
>
> '**** Connect to other databases
> objConnection = new
> SqlConnection(ConfigurationSettings.AppSettings("OLEDBConnectionString"))
> objConnection.OPen()
>
> Harish.
>
> -----Original Message-----
> From: Zach Clements [mailto:clementz@c...]
> Sent: Wednesday, March 27, 2002 7:38 PM
> To: ASP+
> Subject: [aspx] Connect to MySQL database
>
>
> Could someone show me how to connect to a MySql database with ASP.net?
> Thanks
> Zach
>
>
>
Message #4 by "Varga, Tamas" <vargat@s...> on Fri, 29 Mar 2002 16:03:25 +0100
|
|
Here is a useful link for everybody:
http://www.able-consulting.com/ADO_Conn.htm
Mr. Tamas Varga
senior developer, Microsoft Certified Solution Developer
----------------------------------------------------------------------------
-
Sense/Net Hungary Ltd.
Microsoft Gold Certified Partner For E-commerce Solutions
H-1136 Budapest Hegedus Gyula u. 49-51. II/5.
http://www.sensenet.hu/
tv@s...
|
|
 |