You have to install ADO.NET Driver for MySQL (Connector/NET) http://www.mysql.com/products/connector/
hi, For sql server conectivity you have to take folloeing steps: first step: you have to make "System.Data.OleDb" namespace. We need this namespace to work with Microsoft Access and other OLE DB database providers. Second Step:We will create the connection to the database in the Page_Load subroutine. We create a dbconn variable as a new OleDbConnection class with a connection string which identifies the OLE DB provider and the location of the database. Then we open the database connection. ie,code for it %@ Import Namespace="System.Data.OleDb" %> <script runat="server"> sub Page_Load dim dbconn,sql,dbcomm dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("northwind.mdb")) dbconn.Open() sql="SELECT * FROM customers" dbcomm=New OleDbCommand(sql,dbconn) end sub </script> I think this helps you. Goodluck
Its very simple Just go to server explorer , right click in your database and click on connect else just drag your table from your server explorer(Control + S) and put into your design part of your webform Automatically check in web.config file there will be the connection string like this code <connectionString name="" Datasource=""> then in .cs page just write this code public SqlConnection con =new SqlConnection(System.Configuration.ConfigurationManager.ConnectionString["str name"].toString()); con.Open(); SqlDataAdapter ad=new SqlDataAdapter("Select * from Emp",con); Dataset ds=new Dataset(); ad.fill(ds); con.Close(); This is the code for connect database ..