Computing.Net > Forums > Web Development > how to connect mysql database in asp.net?????

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to connect mysql database in asp.net?????

Reply to Message Icon

Name: lalitcdhake
Date: May 23, 2009 at 02:39:50 Pacific
OS: Windows XP
Subcategory: General
Comment:

how to connect mysql database in asp.net???????

I am install mysql 5.0 then i install sqlyog.

After that i create the database sample in mysql with the help of sqlyog.

I want to connect the database in asp.net & display it on gridview.

I have following code
--------------------------------------------------------------------------------
string sConString = "Driver={MySQL ODBC 5.0 Driver};" +
"Server=backupserver;" + "Database=sample;" + "user id=root;" +
"password=girish";
OdbcConnection oConnection = new OdbcConnection(sConString);
string sSQL = "SELECT * FROM user";
OdbcDataAdapter oDataAdapter = new OdbcDataAdapter(sSQL, oConnection);
DataSet oDataSet = new DataSet();
oDataAdapter.Fill(oDataSet);
GridView1.DataSource = oDataSet;
GridView1.DataBind();

----------------------------------------------------------------------------------

but it gives error:

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

----------------------------------------------------------------------------------

What is this problem ?????
How i can i solve the problem ?????
How we set the connection string in mysql for use on aspx page????

Plz give me reply.
Thanks in advance.

Regards
Girish




Sponsored Link
Ads by Google

Response Number 1
Name: pravineconceptt
Date: November 8, 2009 at 08:01:10 Pacific
Reply:

mr Girish,
you did not specified drivers and its name ,
i think you have used mysql server connected architecture
so create datasource name in control panel administrative tools create it by any name and select database what ur using


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: how to connect mysql database in asp.net?????

Date pop-up box in ASP.NET www.computing.net/answers/webdevel/date-popup-box-in-aspnet/833.html

variables in ASP.NET www.computing.net/answers/webdevel/variables-in-aspnet/942.html

Server Controls Array in ASP.NET www.computing.net/answers/webdevel/server-controls-array-in-aspnet/3402.html