ConnectionString - Windows Froms vs ASP

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

Hello,

I have a question about using SQL as data source. I'm creating an
ASP.net application and need to connect to a SQL database. I am
recieving an error indicating that the "SQL server does not exist".
Using the same exact procedure in a windows form application it
connects just fine. The connection strings are exactly the same.

I have browsed through some other posts and the possible solution
appears to be that ASP.net requires you use "Impersonation". I have
inserted a line into the web.config file setting impersonation to
true...but I still get the same problem. Can some one help me with a
possible solution, as it seems to be somewhere else outside of the
vb.net code behind the page.

Thanks for your help,
Jeremy
 
Can you post the connection string you are having problems with?
 
I don't believe the problem is in the connection string, I think
something is funky about connecting to a SQL server through a web based
ASP app.

Connection String is below....works fine in a Windows Form application,
but will not connect in an ASP.Net App:

"Application Name=SQLOLEDB.1;Persist Security Info=False;User
ID=xxx;Password=xxx;Initial Catalog=MyData;Data Source=MyServer;"
 
Jeremy,

You told and I agree with you, that it is probably not in the program.

I would ask this in the newsgroup

Aspnet
news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet

And than when possible for your newsreader crossposted to

Security
news://msnews.microsoft.com/microsoft.public.dotnet.security

When you cannot crosspost I would try Security first, ASPNET is so full with
all other kind of stuff that the change on a good answer for this in that
newsgroup is in my opinion low.

I hope this helps?

Cor
 
Thanks for the advice Cor...After searching the security forum I
discovered there are some issues connecting to a SQL backend via ASP.
The problem was not with the code, but with the IIS security settings.
As soon as I removed the check mark from "Anonymous Access" in IIS
properties and enabled Impersonation in the web.config file, it worked
just fine.
 

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

Back
Top