C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

My sql


Posted Date: 24 Jun 2009      Posted By: Saurabh Chandak      Member Level: Silver     Points: 1   Responses: 5



plz tell me .

Can we connect mysql as a database with asp.net? if yes than plz tell me procedure.

Its very urgent.


Thanks in advance :)





Responses

Author: Anil Kumar Pandey    24 Jun 2009Member Level: DiamondRating: 1 out of 5     Points: 1

hi,

the connection with my sql is same as the SQL server connection..

you just need to specify the provider in the connection string... and the credentials for that.

Thanks & Regards
Anil Kumar Pandey



Author: Viji RAJKUMAR    24 Jun 2009Member Level: DiamondRating: 1 out of 5     Points: 1

Hi,

Yes you can connect.

You should know the connection string to be used.

Check the link

https://support.quadrahosting.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=22

http://www.aspdev.org/sql/asp.net-mysql-connect/

Regards

VIJI RAJKUMAR
Pls rate my Answer if it was supportive
http://vijirajkumar.blogspot.com



Author: Miss Meetu Choudhary    24 Jun 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

yes sure you can connect the MySQL database to ASP.Net...
follow the following steps...
1. get the mysqlconnector from :http://dev.mysql.com/downloads/connector/
for dotnet connector you can directly visit: http://dev.mysql.com/downloads/connector/net/6.0.html

2. After installing the connector. Add a reference to the MySql.Data.dll

3. Then use the namespace using MySql.Data.MySqlClient;

4. Now you can explore the
MySqlConnection
E.g.

MySqlConnection con = new MySqlConnection(constr);
MySqlCommand

E.g.
MySqlCommand cmd = new MySqlCommand("SELECT * FROM client_products WHERE client_id =" + Session["userid"].ToString(), con);
MySqlDataReader
E.g.
MySqlDataReader dr = cmd.ExecuteReader();

Rest The method is almost Same as SQLClient except the objects are of the MySQL

Thanks and Regards
Miss Meetu Choudhary (Site Coordinator)
Go Green Save Green
My Profile on Google



Author: ramakrishna    24 Jun 2009Member Level: BronzeRating:     Points: -20

It is similar to SQL connection only ,but u have to use MYSql DLL.

Then use the namespace using MySql.Data.MySqlClient;

4. Now you can explore the
MySqlConnection
E.g.

MySqlConnection con = new MySqlConnection(constr);
MySqlCommand

E.g.
MySqlCommand cmd = new MySqlCommand("SELECT * FROM client_products WHERE client_id =" + Session["userid"].ToString(), con);
MySqlDataReader
E.g.
MySqlDataReader dr = cmd.ExecuteReader();

Ramakrishna



Author: Miss Meetu Choudhary    24 Jun 2009Member Level: DiamondRating: 3 out of 53 out of 53 out of 5     Points: 3

I marked the above post of Mr. Ramakrishna as copy right violation because he has copied my answer and posted the screen is attached

Thanks and Regards
Miss Meetu Choudhary (Site Coordinator)
Go Green Save Green
My Profile on Google



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Email doubt
Previous : Grid inside grid >>> urgent
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use