Database permission

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have created a C# web project(asp application) where it should access my
database in my laptop and this the connectionstring that I m using:
mySqlConnection =
SqlConnection("Server=(local);Database=Orchestra;Integrated Security=SSPI");
and it's working in my windows application but in my web application its
telling me that it Failed for user Mike (me) when it come to
mySqlConnection.Open(); statment, and I am the only Aministrator of my
laptop!!!?
 
Mike said:
Hi,
I have created a C# web project(asp application) where it should
access my database in my laptop and this the connectionstring that I
m using: mySqlConnection =
SqlConnection("Server=(local);Database=Orchestra;Integrated
Security=SSPI"); and it's working in my windows application but in my
web application its telling me that it Failed for user Mike (me) when
it come to mySqlConnection.Open(); statment, and I am the only
Aministrator of my laptop!!!?

Your webapplication runs under the user ASPNET. Add that user to the
catalog / sqlserver and give it permissions. For example, to test it,
you couldmake it the owner of the catalog to see if this is the reason
it doesn't work now.

FB

--
 
Hi,

You could use SQL auth, I prefer to use this approach for web apps, as you
cannot know where they will land at the end :)
Even better, define the connection string in the config file, in this way
you can change it at a later time


cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
 
Mike said:
Could you pls tell me can I add it

Enterprise manager -> security section, add a new logon, select from
the windows users the ASPNET user, by clicking the [...] button next to
'Name'.

Then in the database access tab, check the database of your
application and in the roles section of that tab, check db_owner.

hit OK.

ASPNET now is a user of your db, and owner of it. Be aware that making
ASPNET an owner of your db might not be the most secure option, I only
suggested it to test if this is the problem you run into. As soon as
you determine it will now work, you should uncheck the owner role
checkbox for the ASPNET user and put proper security grants in place.

FB

--
 

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