473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Connection to SQL Server

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.Get PooledCon
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.
Nov 17 '05 #1
3 1113
Thank you Marc, I'll try.
Can I change the name of the account (ASPNET)?
-----Original Message-----
Hi,

I assume that the account 'DEJO\ASPNET' which ASP.NET uses on your computerhas no security rights on the SQL server. You can add this account to SQLServer using the Enterprise Management Console and give it the necessaryrights to work with the DB you are selecting.

Best regards,

Marc Höppner
NeoGeo

"Dejan Lazic" <de*********@os.hinet.hr> wrote in message
news:97****************************@phx.gbl...
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.Get PooledCon 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.

.

Nov 17 '05 #2
Yes, it works perfectly.
I was confused because the same connetion
worked well in VB.NET. I just learn ASP.NET.
Thank you.
-----Original Message-----
Hi,

I assume that the account 'DEJO\ASPNET' which ASP.NET uses on your computerhas no security rights on the SQL server. You can add this account to SQLServer using the Enterprise Management Console and give it the necessaryrights to work with the DB you are selecting.

Best regards,

Marc Höppner
NeoGeo

"Dejan Lazic" <de*********@os.hinet.hr> wrote in message
news:97****************************@phx.gbl...
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.Get PooledCon 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.

.

Nov 17 '05 #3
Yes, you can change the machine.config which is in the
microsoft.net/framework/ under winnt or windows on your hard drive.

http://support.microsoft.com/default...b;en-us;315158

"Dejan Lazic" <de*********@os.hinet.hr> wrote in message
news:07****************************@phx.gbl...
Thank you Marc, I'll try.
Can I change the name of the account (ASPNET)?
-----Original Message-----
Hi,

I assume that the account 'DEJO\ASPNET' which ASP.NET uses on your computerhas no security rights on the SQL server. You can add this account to SQLServer using the Enterprise Management Console and give it the necessaryrights to work with the DB you are selecting.

Best regards,

Marc Höppner
NeoGeo

"Dejan Lazic" <de*********@os.hinet.hr> wrote in message
news:97****************************@phx.gbl...
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.Get PooledCon 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.

.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Sharon | last post by:
Hi all. I'm trying first time async socket connection. In all the examples i've seen, the server connection is closed when the message is complete. Is it common to close the connection after...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
5
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.