Showing posts with label appreciative. Show all posts
Showing posts with label appreciative. Show all posts

Thursday, March 22, 2012

ConnectionString nightmare

I'm having a hard time making a connection work in my ASP.Net page and would be most appreciative of any help. Here two different code snipets and the errors they generate:

ATTEMPT 1:

Dim cnWebDataUtility As SQLConnection
cnWebDataUtility = new SqlConnection("server="AVILA-4400; database=WebDataUtility; uid=AVILA-4400\ASPNET; pwd=;")
cnWebDataUtility.Open()

ERROR: System.Data.SqlClient.SqlException: Login failed for user 'AVILA-4400\ASPNET'. Reason: Not associated with a trusted SQL Server connection.

ATTEMPT 2:

Dim cnWebDataUtility As SQLConnection
cnWebDataUtility = new SqlConnection("server="AVILA-4400; Database=WebDataUtility; Integrated Security=SSPI")
cnWebDataUtility.Open()

ERROR: System.Data.SqlClient.SqlException: Login failed for user 'AVILA-4400\ASPNET'.

BACKGROUND INFO:

I recently installed SQL Server Developer Edition. During that installation it did not allow me to select anything but "Windows Login" (I am not sure of the exact wording) for authentication, I believe it was. I would expect this to mean, in terms of the connectionstring, "Integrated Security=SSPI." I have tried making this connection in Visual Studio .NET and it works, but when I copy the contents of the ConnectString property in the Properties window in VS to my ConnectionString in the code above, I get errors that it does not recognize a "provider" property, and so on.

How frustrating. If anyone can help me understand this mess, I'd be very grateful.

Thank you,

Paul.I've never seen a connection string with double-quotes around the 'server=' portion of the connection string (probably just a typo?). Nor have I ever seen the server name prepended to the 'uid'. Try:

server=AVILA-4400; database=WebDataUtility; uid=ASPNET; pwd=yourPassword;

I assume that "ASPNET" is the Database Login and you've omitted the password on purpose?

This should work.sqlsql

Sunday, February 12, 2012

Connection problem: ASP.NET on machine and SQL Server on another

If anyone knows the answer to this Id me greatly appreciative.
I am not on a domain.
I have SQL Server sitting on computer A
Computer A has:
Windows XP SP2
SQL Server 2000 SP3a
SQL Server is set to use Trusted or SQL authorization
I have added a user X to SQL Server with a password of X
I am writing an ASP.NET app on Computer B. IIS and Dev on B)
I am trying to make a connection to SQL on computer A but get the
error SQL Server does not exist or access denied
Now when I create a small Winforms app as a test, I can use the exact
same connection string and open a connection to SQL Server just fine.
So, Im guessing the problems lies in the security of ASP.NET, but Im
not sure what to change to make this work.
Anyone with any ideas?
TIA
B
I should also point out, I can also connect just fine withn the same
user/pw with Enterprise Mager, and Query Analyzer as well as add the
connection to Visual Studio.
B
Brian W wrote:

> If anyone knows the answer to this Id me greatly appreciative.
> I am not on a domain.
> I have SQL Server sitting on computer A
> Computer A has:
> Windows XP SP2
> SQL Server 2000 SP3a
> SQL Server is set to use Trusted or SQL authorization
> I have added a user X to SQL Server with a password of X
> I am writing an ASP.NET app on Computer B. IIS and Dev on B)
> I am trying to make a connection to SQL on computer A but get the
> error SQL Server does not exist or access denied
> Now when I create a small Winforms app as a test, I can use the exact
> same connection string and open a connection to SQL Server just fine.
> So, Im guessing the problems lies in the security of ASP.NET, but Im
> not sure what to change to make this work.
> Anyone with any ideas?
> TIA
> B

Connection problem: ASP.NET on machine and SQL Server on another

If anyone knows the answer to this Id me greatly appreciative.
I am not on a domain.
I have SQL Server sitting on computer A
Computer A has:
Windows XP SP2
SQL Server 2000 SP3a
SQL Server is set to use Trusted or SQL authorization
I have added a user X to SQL Server with a password of X
I am writing an ASP.NET app on Computer B. IIS and Dev on B)
I am trying to make a connection to SQL on computer A but get the
error SQL Server does not exist or access denied
Now when I create a small Winforms app as a test, I can use the exact
same connection string and open a connection to SQL Server just fine.
So, Im guessing the problems lies in the security of ASP.NET, but Im
not sure what to change to make this work.
Anyone with any ideas?
TIA
BI should also point out, I can also connect just fine withn the same
user/pw with Enterprise Mager, and Query Analyzer as well as add the
connection to Visual Studio.
B
Brian W wrote:

> If anyone knows the answer to this Id me greatly appreciative.
> I am not on a domain.
> I have SQL Server sitting on computer A
> Computer A has:
> Windows XP SP2
> SQL Server 2000 SP3a
> SQL Server is set to use Trusted or SQL authorization
> I have added a user X to SQL Server with a password of X
> I am writing an ASP.NET app on Computer B. IIS and Dev on B)
> I am trying to make a connection to SQL on computer A but get the
> error SQL Server does not exist or access denied
> Now when I create a small Winforms app as a test, I can use the exact
> same connection string and open a connection to SQL Server just fine.
> So, Im guessing the problems lies in the security of ASP.NET, but Im
> not sure what to change to make this work.
> Anyone with any ideas?
> TIA
> B