i have a project in visual web devoloper and i have an sql database on it... (asp.net)... the database is in .mdf format... is there a way .net can connect to the database?... example... www.blah.com/app_data/database1.mdf id apreciate it...
Printable View
i have a project in visual web devoloper and i have an sql database on it... (asp.net)... the database is in .mdf format... is there a way .net can connect to the database?... example... www.blah.com/app_data/database1.mdf id apreciate it...
Are you talking about having the web application access data stored in the database? If so, is the database server going to be local to the web server?
If you answered yes to both questions above, then you need to use the System.Data.SqlClient namespace to access the data in your database.
If the database will not be local to the web server, then you will need to either access the data via TCP/IP or create web services that return the data your application will be needing.
In a typical situation, the application is hosted by a web host and that web host also hosts the database. In that instance, you would use the System.Data.SqlClient namespace. There are tons of examples on how to do this. Do a search on some of these terms SqlConnection, SqlCommand, SqlDataAdapter, DataSet, DataTable