.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ADO.Net >> Post New QuestionBookmark and Share Subscribe to Forum

connection string for MySQL in asp.net

Posted By: Ramesh     Posted Date: October 30, 2008    Points:2   Category :ADO.Net
Hi All,
I am searching the connection string to connect to MYSQL database through my asp.net application.

Thanks in advance

Responses
Author: susant             
Posted Date: October 30, 2008     Points: 5   

Hi Ramesh just try this..

Using C#
using CoreLab.MySql;
...
MySqlConnection oMySqlConn = new MySqlConnection();
oMySqlConn.ConnectionString =
"User ID=myUsername;" +
"Password=myPassword;" +
"Host=localhost;" +
"Port=3306;" +
"Database=myDatabaseName;" +
"Direct=true;" +
"Protocol=TCP;" +
"Compress=false;" +
"Pooling=true;" +
"Min Pool Size=0;" +
"Max Pool Size=100;" +
"Connection Lifetime=0";
oMySqlConn.Open();
Using VB.NET
Imports CoreLab.MySql
...
Dim oMySqlConn As MySqlConnection = New MySqlConnection()
oMySqlConn.ConnectionString = _
"User ID=myUsername;" & _
"Password=myPassword;" & _
"Host=localhost;" & _
"Port=3306;" & _
"Database=myDatabaseName;" & _
"Direct=true;" & _
"Protocol=TCP;" & _
"Compress=false;" & _
"Pooling=true;" & _
"Min Pool Size=0;" & _
"Max Pool Size=100;" & _
"Connection Lifetime=0"
oMySqlConn.Open()


for more info: http://www.15seconds.com/issue/060317.htm
For download: http://www.devart.com/mysqlnet/download.html

First study MORE INFO, then download that trial version..i think it will help u..

susant
9916351611

Author: Athira Sreejith             
Posted Date: February 24, 2009     Points: 5   

Hi..

C#:

using MySql.Data.MySqlClient;
MySqlConnection oMySqlConn = new MySqlConnection();
oMySqlConn.ConnectionString = "Server=Server;" +
"Database=Test;" +
"Uid=myUsername;Pwd=myPassword;";
oMySqlConn.Open();



VB.NET:

Imports MySql.Data.MySqlClient
Dim oMySqlConn As MySqlConnection = New _
MySqlConnection()
oMySqlConn.ConnectionString = "Server=Server;" & _
Database=Test;Uid=myUsername;Pwd=myPassword;"
oMySqlConn.Open()



Also refer:
http://sqlconnect.googlepages.com/mysqlstrings



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend