Connection to SQL Server

D

Dejan Lazic

Why can't I connect to my SQL database using ASP.NET
(VB.NET) and ADO.NET?
I get the following error:

System.Data.SqlClient.SqlException: Login failed for
user 'DEJO\ASPNET'. at
System.Data.SqlClient.ConnectionPool.GetConnection
(Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledCon
nection(SqlConnectionString options, Boolean&
isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at
MyWebSite.WebForm2.Page_Load(Object sender,
EventArgs e) in C:\Documents and
Settings\Dejan\VSWebCache\DEJO\MyWebSite\WebForm2.aspx.vb:l
ine 29

My connection is:
Imports System.Data.SqlClient
--
Const DBString As String = "Integrated
Security=SSPI;Initial Catalog=Northwind;Data Source=
(local)"
Dim cnn As New SqlConnection(DBString)
cnn.Open()

I use VS.NET 2003, Windows XP SP1, computer's name is
DEJO, SQL Server 2000 is on local computer.
I tried with both permission settings, "Use same
permissions as the root Web server"
and "Use unique permissions for this Web application".

What (Where) do I have to set up?
Thanks in advance.
 
D

Dejan Lazic

Yes, it works perfectly.
I was confused because the same connetion
worked well in VB.NET. I just learn ASP.NET.
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top