Showing posts with label aspnet. Show all posts
Showing posts with label aspnet. Show all posts

Sunday, March 25, 2012

Attach an aspnet or sql2005 database on a sql2000 server

Hello

I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server.

I tried to attach the file directly ; then to attach it to a sql2005 express server, "turning it" into a sql2000 database via the properties, then make a backup, then restore the backup on the 2000 server ; nothing worked out !
One of the method I tried (I don't remember which one) told me it could'nt read the sysindexes table ; of course, because there isn't such table on sql2005 databases.

So, is there a way to attach a SQL2005 database (so with no or few system tables) to a SQL2000 server (which requires those tables), or to re-generate the ASPNETDB in the SQL2000 format ?
If I re-create the syssomething tables on the SQL2005 database, will it work that simply ?

At the very last, I may have to install SQL express on the server. If there is already a SQL2000 server on the machine, will it cohabit with no problem ? Is the SQL express server ready for a production server with light or medium load ?

Thanks a lot, and sorry for so many questions ! :)

Hi,

"I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server."

-That′s not working, the format is different to SQL Server 2k5, there is no backward compatibility.

""turning it" into a sql2000 database"

-Making the compatibility level to 2000 doesn't mean that the database is 2000 ready, it just behaves on a SQL2k5 machine like a SQL 2k database.

You will either have to script the object and the data out or bcp the data out or use any wizard to transfer the objects to the other SQL 2000 Server machine.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Ok, and if I export the database structure as a SQL script, will it just work ?

And for the SQL2005 Express server, is it usable along with the SQL2000 server, and does it fits for a ligt-load production server ?

thanks !
|||

Hi,

sure as long as you don′t use any new features of SQL Server 2005 and you take care of the difference of schema and owner you should be fine.

SQL 2k and SQL2k5X is working together. It can be also used as a light load production server (whatever that means in your case :-) ), it is only limited by the limitations of SQL Server Express, no query governor or anything else.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Saturday, February 25, 2012

ASPState and Windows vista

There is no ASPNET account on Windows Vista. Wich account do I need to use on ASPState database ?

Thanks

Simply use / or create another account for accessing the databases or use the network service account:

http://msdn2.microsoft.com/en-us/library/ms998320.aspx

Jens K. Suessmeyer

http://www.sqlserver2005.de

Friday, February 24, 2012

Aspnet_Profile data extraction

Hello,

in the new aspnet 2, there is a table called Aspnet_Profile wich contains user informations.

Look at the way they are filled

c9d365eb-6981-4c12-bfb8-e9b17445b26d Name:S:0:11:phone:S:11:9: William DOE567876567 <Binary data> 05/10/2005 12:27 35207ce2-8368-4914-95d7-2e0f51414d9c Name:S:0:8:phone:S:8:9: John DOE567876567 <Binary data> 05/10/2005 12:27


The first column is the UniqueIdentifier of user
The second is PropertyNames which contains the structure of the informations. For example here for the first line :
Name is a string wich begins at 0 and is 11 long
Phone is a string wich begins at 11 and is 9 long

The third column contains the informations

then you have here :
Row 1 :
Name : William DOE
Phone: 567876567

Row 2 : John DOE
Phone: 567876567

my problem is to be able to access those informations with a stored procedure.

Can Anyone help me ? thanks a lotYou can write a write a TSQL table-valued UDF that can split the formatted property names and get the lengths. You can then use the offset/lengths with SUBSTRING to get the actual values. The final casting can be done based on the type. But why are you trying to access this information in a SP? What happens if the next service pack or hotfix for .NET changes some of these formats? Maybe if you post what you are trying to do in the .NET newsgroup they will be able to suggest other ways to get the information that you need.

ASPNET worker process account can't login to Database

Hi,
I'm using .Net Remoting and IIS (5.1) to pull data from a (local for now)
SQL Server 2005 database. My application is failing at the point at which a
connection to the database is being opened.
Using cn as New SqlConnection(ConnectString)
cn.Open()
Causes an SQLException to be thrown. The message is...
Cannot open database "AppData" requested by the login. The login failed.
"Login failed for user '<MachineName>\ASPNET'
This is the ASP.Net worker process user. I have had some problems with this
User Id on this machine - it was originally absent from the machine. I got
it back by re-installing ASP.Net (ver 2.0). Now all my remoting stuff is
working, but I cannot get to the data.
So my question is, what configuration items / permissions in SQL Server
should I set up to give the ASPNet worker process access to my data?.
For now the application, SQL Server Instance, and IIS are all on the same
machine. Everything seems to work except for the login call to the Database
.
Thanks for your help.
BBMHello BBM,
You could add the <Machine Name>\ASPNET user in the SQL Login. After that,
you could grant the proper permission for the account to access the sql
database.
Here is an article you could refer:
Building Secure ASP.NET Applications: Authentication, Authorization, and
Secure Communication
http://msdn2.microsoft.com/en-us/library/aa302387.aspx
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==========
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hi Wei Lu,
Thanks for your help. I knew this had to be covered someplace.
BTW, Searching Help in SQL Server, or in Visual Studio on this topic, the
ASP "worker process" account, returns nothing remotely useful.
Thanks again.
BBM
"Wei Lu [MSFT]" wrote:

> Hello BBM,
> You could add the <Machine Name>\ASPNET user in the SQL Login. After that,
> you could grant the proper permission for the account to access the sql
> database.
> Here is an article you could refer:
> Building Secure ASP.NET Applications: Authentication, Authorization, and
> Secure Communication
> http://msdn2.microsoft.com/en-us/library/aa302387.aspx
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ========================================
==========
> Get notification to my posts through email? Please refer to
> l]
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> [url]http://msdn.microsoft.com/subscriptions/support/default.aspx." target="_blank">http://msdn.microsoft.com/subscript...t/default.aspx.
> ========================================
==========
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello BBM,
You could use the MSDN search in the web directly. And you could search for
ASPNET and SQL Server as the key words.
Thanks!
Sincerely,
Wei Lu
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==========
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

ASPNET user Where are others

Hello.

When pages on domain controler I faced problem: ASPNET user does not have access to MS SQL server? WHY does it has to have? My site uses integrated windows authentication.

Thanks in advanceAll you have to do is to to add the ASPNET user (windows user account) to the Users list of your database. To do that in Enterprise Manager, expand your database's tree, click on Users and select New from the toolbar. In the window that will come up select the ASPNET user from the "Login name" dropdownlist.|||I ran into same problem, only that I'm using MSDE and don't know where to get Enterprise Manager. Could you point out which MSDN package (or CD) contains that application? Or is there a way to do it without EM? Thanks a lot!|||Enterprise manager comes with SQL Server. If you don't have SQL Server try to find a replacement of Enterpise Manager. I remember seeing one in www.sourceforge.net. It is web based, built with ASP.NET. I am not sure if it will let you assogn a new user to your DB. But, you can give it a try|||Thanks!|||Well, bun in ASP 3 all I had to do is to grant access to a database for a user who is ACTUALLY browsing my page. Now, in ASP.NET, all the users will have access to a database with the same priveledges, same as ASPNET user. Is there any workaroud?

Thanks

ASPNET user with network resources elsewhere on a domain

I've been trying to workout how, without impersonation, I can allow an application running under the default ASPNET user to access a network resource (SQL Server/ADAM) not on the same physical machine.

It seems that because the ASPNET user is a local user not a domain user I can't setup windows authentication on the network resource. That seems to leave impersonation which MS et al say is unwise.

Have I mised something here?

Regards,

Steve.Yes.

You can change the user running the asp.net process. ONly the STANDARD user is a local user. It CAN also be a domain user, per your choosing.

ASPNET user in MSDE

Hello.

I am using MSDE in an ASP .NET application using forms authentication in order to the user can visit my website anonymously but have to authenticate in some pages.

Web server and MSDE server are in the same computer.

I would like to know how role I should set for the ASPNET sql server user. I am using Microsoft SQL Web Data Administrator and when I am creating the ASPNET user, then a page with some roles is shown.

Roles like public (default), db_owner, db_accessadmin, db_datareader, db_datawriter...

I had applied db_datareader and db_datawriter but now, when I use store procedures in my code, an error is made so I have applied db_owner role for the ASPNET user.

Is this correct or db_owner is a excessive privileged role for the ASPNET user?

Thank you and sorry for my English.DONT EVER GIVE THAT USER DB_OWNER!! You're setting yourself up for sql inject attacks.

The best thing to do is create a role named WebUser and add the asp.net user to that role. Then grant execute permissions to the user.

Here's the script that you need:

exec sp_addrole 'WebUser'
go
exec sp_addrolemember 'WebUser', 'MACHINENAME\ASPNET'
go
grant execute on PROCNAME to WebUser

aspnet user can not access sql server

We have an ASP.net application that currently sits on a server that runs IIS and sql server. We are spliting IIS and SQL server into 2 seperate machines. I believe I have the connection string okay as I can see the entries in the security log on the sql server machine however it keeps saying aspnet user invalid user or invalid password. What gives with this. We put .net on the sql server however this just added the aspnet user to the machine. Do I need to create an aspnet user inside the sql server and give it control of the dbases as well? I am running this using the personal web server not IIS on a server. I have a project on my desktop and am using the "local" IIS or personal web server that comes with visual studio out of the box. What kills me is that when I put the project on a real IIS server that has sql server on the same machine I have no issues. However when I split the dbase and the IIS apart onto 2 servers I get this aspnet invalid user or invalid password.
HELPtry giving database permission to the aspnet user on the other machine (IIS). ex. IISMachine\ASPNET
cheers
Shane Sukul
|Bsc|Mcsd.Net|Mcsd|Mcad|
|||

In SQL Server you can use Windows Authentication or SQL Server Authentication. If in connection string you don't spec. which user and password to use it tries to use Windows Authentication and the user which ASP.NET process runs should have permissions in the SQL Machine.
I normally use SQL Server authentication, put in my web.config (with only permission to the ASP.NET process) the ConnectionString with user and password.
HH
NeuralC

|||

neuralc wrote:

In SQL Server you can use Windows Authentication or SQL Server Authentication. If in connection string you don't spec. which user and password to use it tries to use Windows Authentication and the user which ASP.NET process runs should have permissions in the SQL Machine.
I normally use SQL Server authentication, put in my web.config (with only permission to the ASP.NET process) the ConnectionString with user and password.
HH
NeuralC


Of course you wouldn't actually put that in clear text!
|||

None of this works. The application currently sits on my desktop which is running xp professional. The web server is local to my machine whatever ships with visual studio. The dbase is on a server that has the .net environment running on it. Why can I not see the dbase information when I have the correct connection string.

If I take the same application on my machine and go and hit a server that has IIS adn sql server installed on the same machine it works fine
What gives

|||Also have a look at your firewall settings on the server that hosts your database.

ASPNET user

I just moved my website to a shared host, and I face some trouble.
Since there is more than one DB on the SQL server they don't want to create a ASPNET user. Is there a way to make my SQLCommand use my user name instead of ASPNET ?

Otherwise, can anyone explain to me the result of the ASPNET user on other website who will use the same server as me security wise ?in your connection string, just define the user name and password they assigned you for SQL Server access.|||That's what I do, but when I try to run a stored procedure, I get a security error saying ASPNET user need to have execute access on the SP.

ASPNET User

My application attempts to connect to an SQL Server database as name ASPNET
and Login Name SERVERNAME/ASPNET in response to these commands:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET
with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the
name ASPNET but eliminates the login name. How do I create the correct user
so that my application can log in?
Many thanks.
re:
> I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ?
Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change
the SQL Server's security to "SQL Server and Windows",
instead of "Windows", create a SQL Server login for your database,
and assign it the permissions you want it to have.
You'd have to change the connection string to use either
the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful :
http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this:
http://weblogs.asp.net/AChang/archiv...15/113866.aspx
(In fact, read that even if your SQL Server is in the same machine as your web server)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
> My application attempts to connect to an SQL Server database as name ASPNET and Login
> Name SERVERNAME/ASPNET in response to these commands:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
> Catalog=MCSCRE;Integrated Security=SSPI");
> myConnection.Open();
> However, the user of this database is ASPNET. I can't create a user ASPNET with a login
> name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET but
> eliminates the login name. How do I create the correct user so that my application can
> log in?
> Many thanks.
>
>
|||You are right that the '/' is a typo. The basic problem is exactly the one
discussed in the Q316989 that you reference below. Following that article I
changed SQL Server's security to "SQL Server and Windows". I created a new
user of my database and modified my application connection string as
follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in
Q316989 fails in the same way. It is as though I need a user for SQL Server,
and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
> re:
> You should be able to.
> Are you sure that's not SERVERNAME\ASPNET ?
> Notice the difference in the slash's direction.
> Other than that, which is probably a typo, you could change
> the SQL Server's security to "SQL Server and Windows",
> instead of "Windows", create a SQL Server login for your database,
> and assign it the permissions you want it to have.
> You'd have to change the connection string to use either
> the loginname/password you created, or a Trusted Connection.
> You'll find this to be helpful :
> http://support.microsoft.com/default.aspx?kbid=316989
> If the SQL Server is in a different machine that the web server, make sure
> you read this:
> http://weblogs.asp.net/AChang/archiv...15/113866.aspx
> (In fact, read that even if your SQL Server is in the same machine as your
> web server)
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
>
|||re:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);
> Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is,
and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the
SQL Server Service Manager icon in your taskbar, or open the
"Service Manager" app in the "Start Menu", "Programs",
"Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instance.
Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
> You are right that the '/' is a typo. The basic problem is exactly the one discussed in
> the Q316989 that you reference below. Following that article I changed SQL Server's
> security to "SQL Server and Windows". I created a new user of my database and modified
> my application connection string as follows:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
> Catalog=MCSCRE;User ID=Logger;password=admin");
> It still fails with the same error. Even the three line test program in Q316989 fails in
> the same way. It is as though I need a user for SQL Server, and then a second one for
> the database.
> Any idea what is going on here?
> Many thanks,
> Andrew
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
>
|||The latest saga..
Instead of a new user for my database and loging in as him I logged in as
'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than
inot my database? Obviously, I am new to SQL Server authentication and it is
proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
> re:
> I've had problems connecting when I use (local) for the SQL Server's name.
> Check and see what the real name of your SQL Server instance is,
> and use *that* name in your connection.
> To check the instance name of your SQL Server, double-click the
> SQL Server Service Manager icon in your taskbar, or open the
> "Service Manager" app in the "Start Menu", "Programs",
> "Microsoft SQL Server" start menu menu group.
> The "Server" textbox will tell you the real name for your SQL Server
> instance.
> Try using *that name* in your connection string, instead of (local).
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
>
|||re:
> Instead of a new user for my database and loging in as him I logged in as 'sa' (the
> default SQL user) from my app. That works!
That explains a lot.
The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying
to *login as* doesn't have permissions to the objects for the database you're
trying to use.
Add the login you want to use to SQL Server and then add that user to your
database's users, and then assign permissions for that database's objects to
your new user.
This is an object-by-object assignment.
Make sure that all the relevant permissions to all needed objects are assigned.
Then, you should have no problem with that new user accessing your db.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
> The latest saga..
> Instead of a new user for my database and loging in as him I logged in as 'sa' (the
> deafult SQL user) from my app. That works!
> Is it the case that my ap. was failing to log in to SQL server, rather than inot my
> database? Obviously, I am new to SQL Server authentication and it is proving counter
> intuitive to me.
> Thanks,
> Andrew
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
>
|||That is exactly right. The ASP.NET runs at a lower privilege level.
I followed your steps and the new user, with restricted rights, is accessing
the database fine.
Now, if only I could find out how the ASP.NET user's rights could be
upgraded so that I can use integrated security.
Many thanks for your help!
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:e9I6izv6FHA.2600@.tk2msftngp13.phx.gbl...
> re:
> That explains a lot.
> The "sa" user has read/write permissions to *all* SQL Server's databases.
> Your problem is *not* the login, but that the user your connection is
> trying
> to *login as* doesn't have permissions to the objects for the database
> you're
> trying to use.
> Add the login you want to use to SQL Server and then add that user to your
> database's users, and then assign permissions for that database's objects
> to
> your new user.
> This is an object-by-object assignment.
> Make sure that all the relevant permissions to all needed objects are
> assigned.
> Then, you should have no problem with that new user accessing your db.
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
>

ASPNET User

My application attempts to connect to an SQL Server database as name ASPNET
and Login Name SERVERNAME/ASPNET in response to these commands:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET
with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the
name ASPNET but eliminates the login name. How do I create the correct user
so that my application can log in?
Many thanks.re:
> I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ?
Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change
the SQL Server's security to "SQL Server and Windows",
instead of "Windows", create a SQL Server login for your database,
and assign it the permissions you want it to have.
You'd have to change the connection string to use either
the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful :
http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure y
ou read this:
http://weblogs.asp.net/AChang/archi.../15/113866.aspx
(In fact, read that even if your SQL Server is in the same machine as your w
eb server)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
> My application attempts to connect to an SQL Server database as name ASPNE
T and Login
> Name SERVERNAME/ASPNET in response to these commands:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initia
l
> Catalog=MCSCRE;Integrated Security=SSPI");
> myConnection.Open();
> However, the user of this database is ASPNET. I can't create a user ASPNET
with a login
> name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNE
T but
> eliminates the login name. How do I create the correct user so that my app
lication can
> log in?
> Many thanks.
>
>|||You are right that the '/' is a typo. The basic problem is exactly the one
discussed in the Q316989 that you reference below. Following that article I
changed SQL Server's security to "SQL Server and Windows". I created a new
user of my database and modified my application connection string as
follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in
Q316989 fails in the same way. It is as though I need a user for SQL Server,
and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
> re:
> You should be able to.
> Are you sure that's not SERVERNAME\ASPNET ?
> Notice the difference in the slash's direction.
> Other than that, which is probably a typo, you could change
> the SQL Server's security to "SQL Server and Windows",
> instead of "Windows", create a SQL Server login for your database,
> and assign it the permissions you want it to have.
> You'd have to change the connection string to use either
> the loginname/password you created, or a Trusted Connection.
> You'll find this to be helpful :
> http://support.microsoft.com/default.aspx?kbid=316989
> If the SQL Server is in a different machine that the web server, make sure
> you read this:
> http://weblogs.asp.net/AChang/archi.../15/113866.aspx
> (In fact, read that even if your SQL Server is in the same machine as your
> web server)
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
>|||re:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);
> Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is,
and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the
SQL Server Service Manager icon in your taskbar, or open the
"Service Manager" app in the "Start Menu", "Programs",
"Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instanc
e.
Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
> You are right that the '/' is a typo. The basic problem is exactly the one
discussed in
> the Q316989 that you reference below. Following that article I changed SQL
Server's
> security to "SQL Server and Windows". I created a new user of my database
and modified
> my application connection string as follows:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initia
l
> Catalog=MCSCRE;User ID=Logger;password=admin");
> It still fails with the same error. Even the three line test program in Q3
16989 fails in
> the same way. It is as though I need a user for SQL Server, and then a sec
ond one for
> the database.
> Any idea what is going on here?
> Many thanks,
> Andrew
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
>|||The latest saga..
Instead of a new user for my database and loging in as him I logged in as
'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than
inot my database? Obviously, I am new to SQL Server authentication and it is
proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
> re:
> I've had problems connecting when I use (local) for the SQL Server's name.
> Check and see what the real name of your SQL Server instance is,
> and use *that* name in your connection.
> To check the instance name of your SQL Server, double-click the
> SQL Server Service Manager icon in your taskbar, or open the
> "Service Manager" app in the "Start Menu", "Programs",
> "Microsoft SQL Server" start menu menu group.
> The "Server" textbox will tell you the real name for your SQL Server
> instance.
> Try using *that name* in your connection string, instead of (local).
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
>|||re:
> Instead of a new user for my database and loging in as him I logged in as
'sa' (the
> default SQL user) from my app. That works!
That explains a lot.
The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying
to *login as* doesn't have permissions to the objects for the database you'r
e
trying to use.
Add the login you want to use to SQL Server and then add that user to your
database's users, and then assign permissions for that database's objects to
your new user.
This is an object-by-object assignment.
Make sure that all the relevant permissions to all needed objects are assign
ed.
Then, you should have no problem with that new user accessing your db.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
> The latest saga..
> Instead of a new user for my database and loging in as him I logged in as
'sa' (the
> deafult SQL user) from my app. That works!
> Is it the case that my ap. was failing to log in to SQL server, rather tha
n inot my
> database? Obviously, I am new to SQL Server authentication and it is provi
ng counter
> intuitive to me.
> Thanks,
> Andrew
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
>|||That is exactly right. The ASP.NET runs at a lower privilege level.
I followed your steps and the new user, with restricted rights, is accessing
the database fine.
Now, if only I could find out how the ASP.NET user's rights could be
upgraded so that I can use integrated security.
Many thanks for your help!
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:e9I6izv6FHA.2600@.tk2msftngp13.phx.gbl...
> re:
> That explains a lot.
> The "sa" user has read/write permissions to *all* SQL Server's databases.
> Your problem is *not* the login, but that the user your connection is
> trying
> to *login as* doesn't have permissions to the objects for the database
> you're
> trying to use.
> Add the login you want to use to SQL Server and then add that user to your
> database's users, and then assign permissions for that database's objects
> to
> your new user.
> This is an object-by-object assignment.
> Make sure that all the relevant permissions to all needed objects are
> assigned.
> Then, you should have no problem with that new user accessing your db.
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
>

ASPNET security on my sql server

Dear all

I had a problem connecting to my website (through lan) from other machines in the company here.

I googled some and figured out that I have to change the security settings of aspnet in my sql server express 2005.

I did as suggested and now its working

My question is - what should be the real security settings for aspnet on my sql server ?

Should I really add it to the sysadmin ? (what solved the problem...)

Guy

Security settings depend on your environment. They should by design be the least permissions that allow access, but in your case it would mean configuring a new account just for this purpose and you'd likely not add any additional security in an intranet environment.

Jeff

|||

Hi

Thanks for the reply

I am talking about the real world not the lan

I had the problem on lan and that led me to the question :)

Please tell me what should I do on an Internet case

Guy

|||It still depends on what the website needs to do with SQL Server. What was the problem with the SQL Server connection before you add IIS account (or other account?) to sysadmin role of SQL Server?

Sunday, February 19, 2012

ASPNET permissions error when trying to open an Oracle connectin from a custom assembly.

Hello:
I'm receiving the following error while trying to open an Oracle connection
from a custom assembly; it seems that ASP.NET has insufficient permissions.
OracleConnection oc = null;
// v-- creating connection object, this
is where the exception throws..
oc = new OracleConnection(Def.ConnectString +
";User Id=" + Def.UserName + ";Password=pwdtxt");
I've assigned "FullTrust" to all the CodeGroup entries on my config files,
and I can execute the code in the custom assembly but I can not open a
database connection.
Is there any security setting related with this?
Thanks,
Daniel Bello.
<ErrorCode
xmlns="http://www.microsoft.com/sql/reportingservices">rsAccessDenied</ErrorCode><HttpStatus
xmlns="http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message
xmlns="http://www.microsoft.com/sql/reportingservices">The permissions
granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for performing this
operation.</Message><HelpLink
xmlns="http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00</HelpLink><ProductName
xmlns="http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server
Reporting Services</ProductName><ProductVersion
xmlns="http://www.microsoft.com/sql/reportingservices">9.00.1399.00</ProductVersion><ProductLocaleId
xmlns="http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem
xmlns="http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId
xmlns="http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation
xmlns="http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message
msrs:ErrorCode="rsAccessDenied"
msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00"
xmlns:msrs="http://www.microsoft.com/sql/reportingservices">The permissions
granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for performing this
operation.</Message></MoreInformation><Warnings
xmlns="http://www.microsoft.com/sql/reportingservices" />I added the ASPNET user to HOME with Browser and Content Manager permissions
and it works now.
Does anyoune has an explanation for this?
Thanks,
Daniel Bello.
"Daniel Bello" <dburizarri@.yahoo.es> wrote in message
news:OzjxxzYRHHA.4000@.TK2MSFTNGP04.phx.gbl...
> Hello:
> I'm receiving the following error while trying to open an Oracle
> connection from a custom assembly; it seems that ASP.NET has insufficient
> permissions.
> OracleConnection oc = null;
> // v-- creating connection object, this
> is where the exception throws..
> oc = new OracleConnection(Def.ConnectString +
> ";User Id=" + Def.UserName + ";Password=pwdtxt");
> I've assigned "FullTrust" to all the CodeGroup entries on my config files,
> and I can execute the code in the custom assembly but I can not open a
> database connection.
> Is there any security setting related with this?
> Thanks,
> Daniel Bello.
> <ErrorCode
> xmlns="rsAccessDenied</ErrorCode><HttpStatus">http://www.microsoft.com/sql/reportingservices">rsAccessDenied</ErrorCode><HttpStatus
> xmlns="400</HttpStatus><Message">http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message
> xmlns="The">http://www.microsoft.com/sql/reportingservices">The permissions
> granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for performing
> this operation.</Message><HelpLink
> xmlns="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00</HelpLink><ProductName">http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00</HelpLink><ProductName
> xmlns="Microsoft">http://www.microsoft.com/sql/reportingservices">Microsoft SQL
> Server Reporting Services</ProductName><ProductVersion
> xmlns="9.00.1399.00</ProductVersion><ProductLocaleId">http://www.microsoft.com/sql/reportingservices">9.00.1399.00</ProductVersion><ProductLocaleId
> xmlns="127</ProductLocaleId><OperatingSystem">http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem
> xmlns="OsIndependent</OperatingSystem><CountryLocaleId">http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId
> xmlns="1033</CountryLocaleId><MoreInformation">http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation
> xmlns="<Source>ReportingServicesLibrary</Source><Message">http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message
> msrs:ErrorCode="rsAccessDenied"
> msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsAccessDenied&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=9.00.1399.00"
> xmlns:msrs="The">http://www.microsoft.com/sql/reportingservices">The
> permissions granted to user 'WCORPTWJTCCPB1\ASPNET' are insufficient for
> performing this operation.</Message></MoreInformation><Warnings
> xmlns="http://www.microsoft.com/sql/reportingservices" />
>

ASPNET as db owner

Using Management Studio in SS 2005 on XP when I'm adding a user to a
database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
choice and I am allowed to make ASPNET a user.
But in Server2003, MACHINENAME\ASPNET does not show up as a user.
Why? Can't aspnet be a user on server2003?
Regards,
Gary Blakely
Hello
Yes, I think you can't use machine\aspnet in windows 2003. And you may not
need it. aspnet process may run as network-services account, anonymous, or
something another according to your environment. It depends on that the
connection is remote or not, and the existence of active directory.
Why not first check the asp.net process's account executing arbitrary
asp.net file on your server? If you know it, you can grant the account. Or
alternatively you can impersonate the asp.net process first and grant the
impersonated account.
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:ep3vihSMHHA.4928@.TK2MSFTNGP06.phx.gbl...
> Using Management Studio in SS 2005 on XP when I'm adding a user to a
> database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
> choice and I am allowed to make ASPNET a user.
> But in Server2003, MACHINENAME\ASPNET does not show up as a user.
> Why? Can't aspnet be a user on server2003?
> --
> Regards,
> Gary Blakely
>
|||Hi Gary,
I know that you could not see MACHINENAME\ASPNET on your Windows Server
2003.
If I have misunderstood, please let me know.
Per my test, ASPNET is still existed as a user on Windows Server 2003.
Please check if the ASP.NET component had been installed on your computer.
In SQL Server Management Studio, I also can add it as a SQL Server login.
I would like to provide some links here for your reference:
How to configure the process identity for the ASPNET account in ASP.NET 1.1
when you use IIS 5 Isolation mode in IIS 6.0 on Windows Server 2003
http://support.microsoft.com/kb/895967/
Process and request identity in ASP.NET
http://support.microsoft.com/kb/317012/
FIX: ASP.NET does not work with the default ASPNET account on a domain
controller
http://support.microsoft.com/kb/315158
This should be related to IIS. If this issue perstis, it is recommended
that you have a new post at ASP.NET community for wider audience.
Please feel free to let me know if you have any other questions or concerns.
Charles Wang
Microsoft Online Community Support
================================================== ====
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====
|||Hi Gary,
Just check with you to see if you need further assistance on this issue. If
you have any other questions or concerns, please feel free to contact us.
We are always very glad for further assistance.
Have a good day!
Sincerely yours,
Charles Wang
Microsoft Online Community Support

ASPNET as db owner

Using Management Studio in SS 2005 on XP when I'm adding a user to a
database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
choice and I am allowed to make ASPNET a user.
But in Server2003, MACHINENAME\ASPNET does not show up as a user.
Why? Can't aspnet be a user on server2003?
Regards,
Gary BlakelyHello
Yes, I think you can't use machine\aspnet in windows 2003. And you may not
need it. aspnet process may run as network-services account, anonymous, or
something another according to your environment. It depends on that the
connection is remote or not, and the existence of active directory.
Why not first check the asp.net process's account executing arbitrary
asp.net file on your server? If you know it, you can grant the account. Or
alternatively you can impersonate the asp.net process first and grant the
impersonated account.
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:ep3vihSMHHA.4928@.TK2MSFTNGP06.phx.gbl...
> Using Management Studio in SS 2005 on XP when I'm adding a user to a
> database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
> choice and I am allowed to make ASPNET a user.
> But in Server2003, MACHINENAME\ASPNET does not show up as a user.
> Why? Can't aspnet be a user on server2003?
> --
> Regards,
> Gary Blakely
>|||Hi Gary,
I know that you could not see MACHINENAME\ASPNET on your Windows Server
2003.
If I have misunderstood, please let me know.
Per my test, ASPNET is still existed as a user on Windows Server 2003.
Please check if the ASP.NET component had been installed on your computer.
In SQL Server Management Studio, I also can add it as a SQL Server login.
I would like to provide some links here for your reference:
How to configure the process identity for the ASPNET account in ASP.NET 1.1
when you use IIS 5 Isolation mode in IIS 6.0 on Windows Server 2003
http://support.microsoft.com/kb/895967/
Process and request identity in ASP.NET
http://support.microsoft.com/kb/317012/
FIX: ASP.NET does not work with the default ASPNET account on a domain
controller
http://support.microsoft.com/kb/315158
This should be related to IIS. If this issue perstis, it is recommended
that you have a new post at ASP.NET community for wider audience.
Please feel free to let me know if you have any other questions or concerns.
Charles Wang
Microsoft Online Community Support
========================================
==============
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties, and confers no rights.
========================================
==============|||Hi Gary,
Just check with you to see if you need further assistance on this issue. If
you have any other questions or concerns, please feel free to contact us.
We are always very glad for further assistance.
Have a good day!
Sincerely yours,
Charles Wang
Microsoft Online Community Support

ASPNET as db owner

Using Management Studio in SS 2005 on XP when I'm adding a user to a
database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
choice and I am allowed to make ASPNET a user.
But in Server2003, MACHINENAME\ASPNET does not show up as a user.
Why? Can't aspnet be a user on server2003?
--
Regards,
Gary BlakelyHello
Yes, I think you can't use machine\aspnet in windows 2003. And you may not
need it. aspnet process may run as network-services account, anonymous, or
something another according to your environment. It depends on that the
connection is remote or not, and the existence of active directory.
Why not first check the asp.net process's account executing arbitrary
asp.net file on your server? If you know it, you can grant the account. Or
alternatively you can impersonate the asp.net process first and grant the
impersonated account.
"GaryDean" <GaryDean@.newsgroups.nospam> wrote in message
news:ep3vihSMHHA.4928@.TK2MSFTNGP06.phx.gbl...
> Using Management Studio in SS 2005 on XP when I'm adding a user to a
> database and I browse for objects (logins) I see MACHINENAME\ASPNET as a
> choice and I am allowed to make ASPNET a user.
> But in Server2003, MACHINENAME\ASPNET does not show up as a user.
> Why? Can't aspnet be a user on server2003?
> --
> Regards,
> Gary Blakely
>|||Hi Gary,
I know that you could not see MACHINENAME\ASPNET on your Windows Server
2003.
If I have misunderstood, please let me know.
Per my test, ASPNET is still existed as a user on Windows Server 2003.
Please check if the ASP.NET component had been installed on your computer.
In SQL Server Management Studio, I also can add it as a SQL Server login.
I would like to provide some links here for your reference:
How to configure the process identity for the ASPNET account in ASP.NET 1.1
when you use IIS 5 Isolation mode in IIS 6.0 on Windows Server 2003
http://support.microsoft.com/kb/895967/
Process and request identity in ASP.NET
http://support.microsoft.com/kb/317012/
FIX: ASP.NET does not work with the default ASPNET account on a domain
controller
http://support.microsoft.com/kb/315158
This should be related to IIS. If this issue perstis, it is recommended
that you have a new post at ASP.NET community for wider audience.
Please feel free to let me know if you have any other questions or concerns.
Charles Wang
Microsoft Online Community Support
======================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||Hi Gary,
Just check with you to see if you need further assistance on this issue. If
you have any other questions or concerns, please feel free to contact us.
We are always very glad for further assistance.
Have a good day!
Sincerely yours,
Charles Wang
Microsoft Online Community Support

ASPNET Acct in SQL Server 2000

I have windows Server 2003 w/ IIS 6.0 running an asp.net
web application. The web application needs to connect to
another server, with SQL Server 2000 installed. We also
have Active Directory.
My question is how do I get the ASPNET account to show up
in the list of users on SQL Server? Do I need to add it
to Active directory? Do I need to create another user as
ASPNET on SQL Server?
Thanks for the help.
Steve M.815154 HOW TO: Configure SQL Server Security for .NET Applications
http://support.microsoft.com/?id=815154
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

ASPNET account permissions

I am new to Reporting Services and still learning, but it is a very nice exciting program. I built a new Report and was experimenting with Grouping in reports and using the parameters. Now I would like to Deploy the report to the Report Server so I can use this report on our intranet, however I get the error that the ASPNET account does not have the proper permissions. I am sure that I need to set up ASPNET to have "write" abilities.

What folder(s) do I need to make sure that ASPNET has this? Or should I be looking elsewhere to set up the ASPNET account on the Report Server?

Thanks for the information.

Will you post the exact error message you are seeing? Does it indicate which resource is not permissioned?|||

This is the exact error message when I try to deploy the report:

Error 1 The permissions granted to user 'BRAD\ASPNET' are insufficient for performing this operation. 0 0

|||The folder that needs permission is the root folder in the report server namespace. But running as the ASPNet account is usually not what you want, since all users will be connecting as the same user account. It looks like your report server config file has impersonation turned off. Is this something you changed intentionally?|||

Brian,

For now I did go into Report Services through the SQL Management Studios, went into properties and did see that ASPNET was unchecked. I checked it and now the reports deploy just fine.

Thanks for the great information.

ASPNET account can't connect to MSSQLSERVER

When I try to access my PasswordRecovery.aspx page I get an error. I've also added the Event Warning and the Failure Audit. I've tried deleting the ASPNET user account and recreating it using aspnet_regiis.exe. I still get the same error message. Should I add the ASPNET account to the Administrators group? Currently it is with the Users group.

Login failed for user 'PC325862970629\ASPNET'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'PC325862970629\ASPNET'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Login failed for user 'PC325862970629\ASPNET'.]

System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734979

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188

System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838

System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33

System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628

System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170

System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359

System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28

System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424

System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496

System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82

System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105

System.Data.SqlClient.SqlConnection.Open() +111

System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84

System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197

System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121

System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105

System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42

System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83

System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160

System.Web.UI.WebControls.Login.AttemptLogin() +105

System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35

System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115

System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

When I check my Events log I see this warning:

-

Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 8/24/2006
Time: 5:13:54 PM
User: N/A
Computer: PC325862970629
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 8/24/2006 5:13:54 PM
Event time (UTC): 8/25/2006 12:13:54 AM
Event ID: b3b1e4fbbd634d04a5acd3de09a4df88
Event sequence: 22
Event occurrence: 7
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/Root/Aidms-1-128009374139687500
Trust level: Full
Application Virtual Path: /Aidms
Application Path: C:\aidms\
Machine name: PC325862970629
Process information:
Process ID: 5128
Process name: aspnet_wp.exe
Account name: PC325862970629\ASPNET
Exception information:
Exception type: SqlException
Exception message: Login failed for user 'PC325862970629\ASPNET'.
Request information:
Request URL: http://localhost/Aidms/Default.aspx
Request path: /Aidms/Default.aspx
User host address: 127.0.0.1
User:
Is authenticated: False
Authentication Type:
Thread account name: PC325862970629\ASPNET
Thread information:
Thread ID: 1
Thread account name: PC325862970629\ASPNET
Is impersonating: False
Stack trace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate)
at System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation)
at System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved)
at System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password)
at System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)
at System.Web.UI.WebControls.Login.AttemptLogin()
at System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

And then I see this Failutre Audit

--

Event Type: Failure Audit
Event Source: MSSQLSERVER
Event Category: (4)
Event ID: 18456
Date: 8/24/2006
Time: 5:13:54 PM
User: PC325862970629\ASPNET
Computer: PC325862970629
Description:
Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 18 48 00 00 0e 00 00 00 .H......
0008: 0f 00 00 00 50 00 43 00 ....P.C.
0010: 33 00 32 00 35 00 38 00 3.2.5.8.
0018: 36 00 32 00 39 00 37 00 6.2.9.7.
0020: 30 00 36 00 32 00 39 00 0.6.2.9.
0028: 00 00 07 00 00 00 6d 00 ......m.
0030: 61 00 73 00 74 00 65 00 a.s.t.e.
0038: 72 00 00 00 r...

The security folks may be able to answer this more quickly.

Thanks,
Sam

|||Is your ASP.NET app and SQL Server both in the same machine?|||Yes both ASP and SQLSERVRER are running on the same machine.|||

Can you have a look at the errorlog file of SQL Server and copy the error logged there? It should be under the LOG directory of your installation. A new log is created after each restart, so you may have to look at several files to find the one that contains this error.

Also, have you allowed the ASPNET account to access your SQL Server installation? Did this connection ever work or is it the first time you tried it?

Thanks
Laurentiu

|||I didn't have to allow the ASNET account access to my SQL Server installation before because it was working fine. Can you please give me the instructions to allow access to my SQL server?

Below is the log file from SQL server that I believe ties in to the above problem.
-
2006-08-24 16:55:27.06 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-08-24 16:55:27.06 Server (c) 2005 Microsoft Corporation.
2006-08-24 16:55:27.06 Server All rights reserved.
2006-08-24 16:55:27.06 Server Server process ID is 2636.
2006-08-24 16:55:27.06 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-08-24 16:55:27.06 Server This instance of SQL Server last reported using a process ID of 476 at 8/24/2006 4:53:33 PM (local) 8/24/2006 11:53:33 PM (UTC). This is an informational message only; no user action is required.
2006-08-24 16:55:28.46 Server Registry startup parameters:
2006-08-24 16:55:28.54 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-08-24 16:55:28.54 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-08-24 16:55:28.54 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2006-08-24 16:55:29.46 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2006-08-24 16:55:29.46 Server Detected 1 CPUs. This is an informational message; no user action is required.
2006-08-24 16:55:33.07 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2006-08-24 16:55:35.20 Server Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.
2006-08-24 16:55:37.06 Server The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service.
2006-08-24 16:55:37.15 Server Database Mirroring Transport is disabled in the endpoint configuration.
2006-08-24 16:55:37.37 spid5s Starting up database 'master'.
2006-08-24 16:55:37.82 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2006-08-24 16:55:38.37 spid5s SQL Trace ID 1 was started by login "sa".
2006-08-24 16:55:38.46 spid5s Starting up database 'mssqlsystemresource'.
2006-08-24 16:55:38.92 spid9s Starting up database 'model'.
2006-08-24 16:55:38.93 spid5s Server name is 'PC325862970629'. This is an informational message only. No user action is required.
2006-08-24 16:55:39.26 Server A self-generated certificate was successfully loaded for encryption.
2006-08-24 16:55:39.28 Server Server is listening on [ 'any' <ipv4> 1433].
2006-08-24 16:55:39.28 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2006-08-24 16:55:39.28 Server Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ].
2006-08-24 16:55:39.28 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2006-08-24 16:55:39.28 Server Dedicated admin connection support was established for listening locally on port 1434.
2006-08-24 16:55:39.32 Server The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2006-08-24 16:55:39.34 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.
2006-08-24 16:55:39.87 spid9s Clearing tempdb database.
2006-08-24 16:55:41.20 spid9s Starting up database 'tempdb'.
2006-08-24 16:55:42.79 spid12s The Service Broker protocol transport is disabled or not configured.
2006-08-24 16:55:42.79 spid12s The Database Mirroring protocol transport is disabled or not configured.
2006-08-24 16:55:42.92 spid12s Service Broker manager has started.
2006-08-24 16:55:45.23 spid14s Starting up database 'msdb'.
2006-08-24 16:55:45.23 spid16s Starting up database 'Aidms'.
2006-08-24 16:55:48.67 spid5s Recovery is complete. This is an informational message only. No user action is required.
2006-08-24 16:57:16.43 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 16:57:16.43 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 16:57:31.57 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 16:57:31.57 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 16:58:41.96 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 16:58:41.96 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:06:49.76 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:06:49.76 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:09:40.25 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:09:40.25 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:13:54.57 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:13:54.57 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:23:59.60 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:23:59.60 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:36:26.00 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
2006-08-24 17:36:28.03 spid12s Service Broker manager has shut down.
2006-08-24 17:36:28.04 spid12s Error: 17054, Severity: 16, State: 1.
2006-08-24 17:36:28.04 spid12s The current event was not reported to the Windows Events log. Operating system error = 31(A device attached to the system is not functioning.). You may need to clear the Windows Events log if it is full.
2006-08-24 17:36:31.17 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
2006-08-24 17:36:33.01 Server The SQL Network Interface library could not deregister the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Administrator should deregister this SPN manually to avoid client authentication errors.|||

You can execute:

CREATE LOGIN [PC325862970629\ASPNET] FROM WINDOWS

to create a SQL login for the ASPNET account. Let us know if this doesn't solve the login failure. I am not sure about the additional permissions that you need to grant to the ASPNET account for your application to work. A better forum for such further inquiries would be the ASP.Net forum at: http://forums.asp.net/default.aspx.

Thanks
Laurentiu

|||Aspnet_regiis.exe creates the ASPNET account for windows. I've deleted and recreated the account twice but I still get the same above error. Any help from a Microsoft representative would help in addition to the suggestions that have been given to far.|||

The command I mentioned in my previous post needs to be executed within SQL Server. You need to connect to SQL Server using a tool like sqlcmd or Management Studio, and issue that command to allow the ASPNET account to connect to SQL Server.

Thanks
Laurentiu

|||Thank you very much. Your previous post was te solution to my problem.

aspnet account and sql server 2005

can anyone give me step by step instructions as to how I would go about correctly granting the aspnet account access to my sql server 2005 database ??

As far as I can see Ive set it up, but im getting execute permissions errors on stored procedures even though Ive gone into properties and permissions and added the aspnet account with execute permissions.

There are no properties involved in granting Asp.net permissions in your database, you create the server permissions in the security section under management in Management Studio and you create the database permissions in the new security section in the database section of Management Studio. Hope this helps.