A couple of questions. Can you connect to a SQL Server in ASP.NET?
If so how?
Printable View
A couple of questions. Can you connect to a SQL Server in ASP.NET?
If so how?
Here's how (details)
http://www.cs.swan.ac.uk/~csneal/Rel...b/Example.html
Question 1: Yes.
Question 2: It depends :)
Out of the box, ASP.Net ships with a number of controls that allow you to directly bind your UI elements to a SQL Server Database. This is done using a server control called SqlDataSource. This control is fine for getting started, but for the longer term, it really isn't recommended.
Instead, you should be looking to use ADO.Net, using classes like SqlConnection, SqlCommand, etc. For information on how to do this, check out the ADO.Net links in my signature.
There are also, other newer ways of doing this, using things like LINQ to SQL and the Entity Framework.
If you provide more information about what exactly you are trying to achieve then the best course of action can be recommended.
Gary