Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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

![]() |
![]() |
![]() |

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