473,395 Members | 1,442 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,395 software developers and data experts.

Database permission

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;I ntegrated 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!!!?
--
Regads,
Rochdi
Nov 17 '05 #1
4 1584
Mike wrote:
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;I ntegrated
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

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 17 '05 #2
Could you pls tell me can I add it
--
Regads,
Rochdi
"Frans Bouma [C# MVP]" wrote:
Mike wrote:
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;I ntegrated
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

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------

Nov 17 '05 #3
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" <Mi**@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
Could you pls tell me can I add it
--
Regads,
Rochdi
"Frans Bouma [C# MVP]" wrote:
Mike wrote:
> 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;I ntegrated
> 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

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------

Nov 17 '05 #4
Mike wrote:
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

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 17 '05 #5

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

Similar topics

3
by: Mark | last post by:
Hi - I want to provide a secure (ASP) based file browser - based on a parent/child table of files/images etc - stored in a directory on a server. I want to be able to have individuals, who...
4
by: TJ Olaes | last post by:
Hello all, this is my second post to this newsgroup. It's a question about stored procedures and permissions and how these behave between databases. Here's the scenario. I have a database that...
2
by: J.Beaulieu | last post by:
Hi I'll have probably to use sql server soon but prior to that I have a question concerning priviledges and security. Is it possible for someone to do like in access, ie creating a db/table...
4
by: Nicolae Fieraru | last post by:
Hi All, I am working on a web site in asp which will be hosted on a Windows 2003 server. I use the following code to connect to the database: Set objConn =...
14
by: L Mehl | last post by:
I tested a FE/BE application developed in A2000 on a A2002 machine and got this message when exiting the app. Clicking the only available button "OK", exits the application, as intended. The FE...
3
by: MW de Jager | last post by:
I'm having endless problems with gaining access to an Access Database that sits on a different server. My ASP.NET app cannot gain control. The errror message I get is: The Microsoft Jet...
2
by: Loane Sharp | last post by:
Hi there Please help! I'm at my wits' end... I am using the System.Data.SQLClient namespace in an ASP.NET web application to connect to a local instance of SQL Server 2005 Express. Using...
2
by: Enska | last post by:
I have problems connecting my access database I get information .. I cant use my database and I'm administrator on my computer so permission shutnot bee problem, but I dont know Where is the...
0
by: dphill | last post by:
Hello all I am a beginner .Net programmer so please forgive my ignorance. In brief, I am trying to read from xml file stored in a SQL database table’s field. This is what I used to create...
2
by: le0 | last post by:
guys, this is my first time to deploy website to the server, but every time i access the page this error always appears. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.