Click to See Complete Forum and Search --> : [RESOLVED] SQLServer + ASP.NET not connecting


AlphaTester
March 8th, 2007, 05:15 AM
Hi guys,

I'm trying to develop a web based project for my companie's intranet, We are in a domain, aswell as the SQLServer, i'm in my machine WS-DEV001
the SQLServer is on \\PANORAMIX\SHAREPOINT.

When i create an sqlconnection with the connectionstring = "Data Source=PANORAMIX\SHAREPOINT;Initial Catalog=Testing;Integrated Security=SSPI;"

when i try to open the connection i allways get this error:

System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. AT

System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) AT

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) AT

System.Data.SqlClient.SqlConnection.Open() AT

WebApplication3.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication3\WebForm1.aspx.vb:line 41

now, the thing is, i've tried to look it up in various news groups, msdn, all over the internet, and i allways get the same answers, problems with user accounts, impersonation (not sure what it is (i'm kinda new to all this coding scene :P)), or windows or server authentication.. i don't know what to do more :|
Can anyone help me? or give any ideias or links to some kind of exlplanations. I'm sure its quite a simple answer i'm just too newb in all of this to see it :( :(


edit: ok, solved it now. Just had to ad a user account with read/write permissions and change my connection string too :

mycon.ConnectionString = "User Id=test; Password=test; server=PANORAMIX\SHAREPOINT; database=Testing;"

/me is ashamed :P

Bill Crawley
March 8th, 2007, 08:38 AM
On server= place \\ firsrt.

If This doesn't work, the way I normally get round this is to place an SQLConnection control on the form, right mouseclick and then use the wizrd to build the connection string. You can then look at the code generated, cut and paste it and remove the control. This has always worked for me.

AlphaTester
March 8th, 2007, 12:03 PM
thanks, but i solved it another way! :)
I edited the solution for me. :p

mcmcom
March 8th, 2007, 12:17 PM
then mark this thread as resolved please.

mcm