![]() |
Connecting to MSSQL Server in ASP.NET
Everything you need comes with the .NET Framework. When you say you are trying to connect to SQL Server, you need to know a bit more than how to create a connection, but also how to return data and display it. Firstly, there are actually many ways to do this in .NET - some in code, some through the IDE and wizards.
To give your page access to the classes you will need to perform SQL data access, you must import the System.Data and System.Data.SqlClient namespaces into your page or codebehind. Code:
<%@ Import Namespace="System.Data" %>Code:
mySqlConnection = new SqlConnection("server=mssql.win-servers.com;user=dbuser;password=dbpwd;database=db")Code:
<%@ Page Language="VB" Debug="true" %> |
Re: Connecting to MSSQL Server in ASP.NET
thanks alot
|
| All times are GMT +5.5. The time now is 08:51. |