Basics on how to connect with a database
In PHP you set up a database and table structure using mysql. You have a connection with a username and password; a sql code to be executed and a result.
How do you do that in an asp.net framework?
Especially the connection.
July 27th, 2012, 07:05 AM
<%@ Import Namespace=""System.Data.OleDb"" %>
dbconn=New OleDbConnection (""Provider=Microsoft.Jet.OLEDB.4.0; data source="" & server.mappath (""northwind.mdb""))
July 29th, 2012, 07:27 PM
Google "ASP.NET Connecting to Database" and check out the Microsoft MSDN page. It provides some pretty straightforward instructions on how to do this.
August 6th, 2012, 01:24 PM
1. the counter part of mysql (php) is MSSql (.NET) , generally. Although .NET can connect with other databases including mysql. Rest table strucute and sql querires are similar
2. in .NET as well you have a connection with username and password. you use System.Data.Sql.SqlClient Namespace to create objects of sqlconnection class. one thing though, 90% of the times the mysql database host with php is localhost but in .NET you have to provide the server address. counterpart of localhost is '.'
3. sql code is same, additionally you can take advantage of stored procedures in MSSql, i guess recent versions of mysql also support stored procedures now.
4. result in php is a variable and in .NET its DataSet or DataTable.
September 13th, 2012, 01:17 AM
Before you can access data in a database, you must create a connection to the database.In PHP, this is done with the mysql_connect() function.