Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Wednesday, March 28, 2012

Help on SQL Query

Hi,

I have a table called employee. I have fields like Emp.Nbr and login.date. I want to retrieve unique data of employee numbers. But I want unique with max(login.date) of an employee.

Ex: 111 7/19/2007

222 6/13/2007

111 7/25/2007

333 5/21/2007

222 7/12/2007

I want out put like

111 7/25/2007

222 7/12/2007

333 5/21/2007

How to write query for the above out put.

Kindly help.

Thanks

SELECT EMP.NBR,MAX(login.date)

FROM EMP INNER JOIN Login

on EMP.ID = Login.EmpId

Group by EMP.NBR

|||

select Nbr,max(LoginDate)

from emp

group by nbr

|||

Here it is,


Code Snippet

Create Table #emp (

[EmpId] Varchar(100) ,

[Date] DateTime

);

Insert Into #emp Values('111','7/19/2007');

Insert Into #emp Values('222','6/13/2007');

Insert Into #emp Values('111','7/25/2007');

Insert Into #emp Values('333','5/21/2007');

Insert Into #emp Values('222','7/12/2007');

Select EmpId, Max(Date) As date From #emp Group By EmpID

|||

hope this will suites your requirement: Here I have used Table Variable instead of Temporary Tables.

DECLARE @.Table TABLE ( Nbr int , LoginDate smalldatetime )

INSERT INTO @.Table (Nbr, LoginDate) VALUES(111, '7/19/2007')

INSERT INTO @.Table (Nbr, LoginDate) VALUES(222, '6/13/2007')

INSERT INTO @.Table (Nbr, LoginDate) VALUES(111, '7/25/2007')

INSERT INTO @.Table (Nbr, LoginDate) VALUES(333, '5/21/2007')

INSERT INTO @.Table (Nbr, LoginDate) VALUES(222, '7/12/2007')

SELECT

Nbr, max(LoginDate)

FROM @.Table

GROUP BY Nbr

Regards,

Prashanthi.

Help on script

Can anyone please help me with a script to do the following in SQL Server 2005?

I would like to grant a login (already exists in the database) to have SELECT only permission on a specific database with a specific table.

Any help is appreciated. Thanks!

You can try this script

use [database]
GRANT select on [table] to [user]

details can be found on

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/a760c16a-4d2d-43f2-be81-ae9315f38185.htm

Monday, March 26, 2012

help on login issue

Hi,
I restored a db on a new server. I remeber I got a sql statement or store pr
ocedure to get all "sp_change_users_login" for the db, ie, the query result
is a list of sp_change_users_login statment for each login, so I don't need
to type for every user. But
I can't find it anymore. anyone can help? ThanksHere are some related links:
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
Andrew J. Kelly SQL MVP
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:08DCEBA2-C07B-4F12-B65A-1ACBB19CAD71@.microsoft.com...
> Hi,
> I restored a db on a new server. I remeber I got a sql statement or store
procedure to get all "sp_change_users_login" for the db, ie, the query
result is a list of sp_change_users_login statment for each login, so I
don't need to type for every user. But I can't find it anymore. anyone can
help? Thanks

help on login issue

Hi,
I restored a db on a new server. I remeber I got a sql statement or store procedure to get all "sp_change_users_login" for the db, ie, the query result is a list of sp_change_users_login statment for each login, so I don't need to type for every user. But I can't find it anymore. anyone can help? ThanksHere are some related links:
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
Andrew J. Kelly SQL MVP
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:08DCEBA2-C07B-4F12-B65A-1ACBB19CAD71@.microsoft.com...
> Hi,
> I restored a db on a new server. I remeber I got a sql statement or store
procedure to get all "sp_change_users_login" for the db, ie, the query
result is a list of sp_change_users_login statment for each login, so I
don't need to type for every user. But I can't find it anymore. anyone can
help? Thanks

help on login issue

Hi,
I restored a db on a new server. I remeber I got a sql statement or store procedure to get all "sp_change_users_login" for the db, ie, the query result is a list of sp_change_users_login statment for each login, so I don't need to type for every user. But
I can't find it anymore. anyone can help? Thanks
Here are some related links:
http://www.support.microsoft.com/?id=314546 Moving DB's between Servers
http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465 Using WITH MOVE in a
Restore
http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers
http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after a
Restore
http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to
users
http://www.support.microsoft.com/?id=168001 User Logon and/or Permission
Errors After Restoring Dump
http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers
Andrew J. Kelly SQL MVP
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:08DCEBA2-C07B-4F12-B65A-1ACBB19CAD71@.microsoft.com...
> Hi,
> I restored a db on a new server. I remeber I got a sql statement or store
procedure to get all "sp_change_users_login" for the db, ie, the query
result is a list of sp_change_users_login statment for each login, so I
don't need to type for every user. But I can't find it anymore. anyone can
help? Thanks
sql

Wednesday, March 21, 2012

Help on Agent Login Change

Hello,
I need to change the SQLAgent start up login in roder to begin a
replication scenario.
I have been using "system account" byt now wish to change it to
another one I set up - Publish. Publish is an administartor account,
is in the Logins section, etc.
When I changed the SQLAgent and tried to restart it I received an
error as follow -
Could not start the SQLServerAgent service on Local Computer.
The service did not return an error. This could be an internal Windows
error or and internal service error.
If the problem persists, contact your system administrator.
When I tried to go back to the system account I got the same error and
now cannot start the SQLAgent.
Anyone have any suggestions on how to resolve this ?
THANK YOU in advance !
Jon SpartanWhat do you have in SQLAgent.out file?
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Jon Spartan" <jonu@.ixtech.net> wrote in message
news:23ltqvsp52v2gm1n22nflf100g41o6ddrv@.4ax.com...
> Hello,
> I need to change the SQLAgent start up login in roder to begin a
> replication scenario.
> I have been using "system account" byt now wish to change it to
> another one I set up - Publish. Publish is an administartor account,
> is in the Logins section, etc.
> When I changed the SQLAgent and tried to restart it I received an
> error as follow -
> Could not start the SQLServerAgent service on Local Computer.
> The service did not return an error. This could be an internal Windows
> error or and internal service error.
> If the problem persists, contact your system administrator.
> When I tried to go back to the system account I got the same error and
> now cannot start the SQLAgent.
> Anyone have any suggestions on how to resolve this ?
> THANK YOU in advance !
> Jon Spartan|||Contents of SQLAgent.Out are as follows -
11/10/2003 8:56:32 AM - ? [129] SQLServerAgent starting under Windows
NT service control
11/10/2003 8:56:37 AM - ! [298] SQLServer Error: 18456, Login failed
for user 'NT AUTHORITY\SYSTEM'. [SQLSTATE 28000]
11/10/2003 8:56:37 AM - ! [000] Unable to connect to server;
SQLServerAgent cannot start
11/10/2003 8:57:01 AM - ? [098] SQLServerAgent terminated (normally)
On Mon, 10 Nov 2003 00:00:06 GMT, Jon Spartan <jonu@.ixtech.net> wrote:
>Hello,
>I need to change the SQLAgent start up login in roder to begin a
>replication scenario.
>I have been using "system account" byt now wish to change it to
>another one I set up - Publish. Publish is an administartor account,
>is in the Logins section, etc.
>When I changed the SQLAgent and tried to restart it I received an
>error as follow -
>Could not start the SQLServerAgent service on Local Computer.
>The service did not return an error. This could be an internal Windows
>error or and internal service error.
>If the problem persists, contact your system administrator.
>When I tried to go back to the system account I got the same error and
>now cannot start the SQLAgent.
>Anyone have any suggestions on how to resolve this ?
>THANK YOU in advance !
>Jon Spartan|||That is strange. The error message suggests that Agent tries to login as
LocalSystem, and it cannot do that because that isn't added as a Windows
Login. LocaSystem should be there, and also you mention that you aren't
using LocalSystem. Sorry, beats me...
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Jon Spartan" <jonu@.ixtech.net> wrote in message
news:jhbvqv08sbaehnl7lsrvk1ooa59090mpjf@.4ax.com...
> Contents of SQLAgent.Out are as follows -
> 11/10/2003 8:56:32 AM - ? [129] SQLServerAgent starting under Windows
> NT service control
> 11/10/2003 8:56:37 AM - ! [298] SQLServer Error: 18456, Login failed
> for user 'NT AUTHORITY\SYSTEM'. [SQLSTATE 28000]
> 11/10/2003 8:56:37 AM - ! [000] Unable to connect to server;
> SQLServerAgent cannot start
> 11/10/2003 8:57:01 AM - ? [098] SQLServerAgent terminated (normally)
>
> On Mon, 10 Nov 2003 00:00:06 GMT, Jon Spartan <jonu@.ixtech.net> wrote:
> >Hello,
> >
> >I need to change the SQLAgent start up login in roder to begin a
> >replication scenario.
> >
> >I have been using "system account" byt now wish to change it to
> >another one I set up - Publish. Publish is an administartor account,
> >is in the Logins section, etc.
> >
> >When I changed the SQLAgent and tried to restart it I received an
> >error as follow -
> >
> >Could not start the SQLServerAgent service on Local Computer.
> >The service did not return an error. This could be an internal Windows
> >error or and internal service error.
> >If the problem persists, contact your system administrator.
> >
> >When I tried to go back to the system account I got the same error and
> >now cannot start the SQLAgent.
> >
> >Anyone have any suggestions on how to resolve this ?
> >
> >THANK YOU in advance !
> >
> >Jon Spartan
>

Monday, March 12, 2012

help needed to validate 2 users at once

hi all, i want to ask about validating 2 users (2 userids and 2 pws) with one button. my database table called login and it has loginId and password.

have tried

"SELECT * FROM login Where loginId = '" + hoName + "', '" + toName + "' AND password = '" + hoPassword + "', '" + toPassword + "'"

please help me!!

i'm using 03 to build, theres no errors. but when i view in browser and try to validate. a wole lot of errors come out.

|||

hi all, can anyone help me please?

|||

I didnt get u r question. Can u explain in detail. You want to check the two users and their passwords at a time or what. Clarity is required.If u give the reply i can try out and i will try to give the solution

Thank u

Baba

|||

SELECT COUNT(*)

FROM Users

WHERE (UserID=@.UserID1 ANDPWD=@.PWD1) OR (UserID=@.UserID2 ANDPWD=@.PWD2)

|||

thanks all.

Friday, February 24, 2012

help me understand how to move the express database to live

im using the the login controls with asp.net

when i test locally everything works great, its see the ASPNETDB.MDF file, checks the login info and passes the user on to the next page.

However when i move the application to the live server it fails, it cant find the datasource that contains users/password etc. here is there error:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

So im missing something here, im used to connecting directly to a remote SQL database and accessing the info from there.

Can someone point me in the right direction? Can the MDF file not be used off the server itself without SQL express installed? Do i need to migrate those tables into a real SQL database?

Thanks,
Sean

update:

installed SQL express on the webserver and it seems to work better now.

I dont get the same error however the user can not login, each time i get "invalid login etc".

If i use the local debug mode it will login correctly.

:(

Any ideas where i need to look?|||

still no luck with this.

can anyone help me understand the process of moving a sql express DB to a production enviroment with SQL Server 2000?

Help me to fix this error

hi all

Server Error in '/test' Application.

Cannot open database requested in login 'mehr'. Login fails. Login failed for user 'COMPUTER2\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: Cannot open database requested in login 'mehr'. Login fails. Login failed for user 'COMPUTER2\ASPNET'.
Source Error:
Line 67: Line 68: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickLine 69: cmd.Connection.Open()Line 70: cmd.ExecuteNonQuery()Line 71: cmd.Connection.Close()

Source File:c:\inetpub\wwwroot\test\WebForm1.aspx.vb Line:69
Stack Trace:
[SqlException: Cannot open database requested in login 'mehr'. Login fails.Login failed for user 'COMPUTER2\ASPNET'.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 test.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\test\WebForm1.aspx.vb:69 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1277


Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573


thanks for your replyMeans user computer2/aspnet isnt a valid user in your database mehr. You either need to add the user, or add a different user to your connection string.

Nick

HELP ME PLEASE! GODADDY - ASPNETDB Security DB

Hi,

I have two sql db's. One for company record info, other for users (aspnetdb) I created the users one using the login control and web administration wizard. This all worked well until I had to publish to godaddy. I had to rebuild my company db, but eventually I was able to pull info and all that is working. The problem is, how the heck do I add users? I noticed that it put users table in my db to start. So I manually went into the db on godaddy's servers, and added an application. Then when I tried to add a user manually, it kept giving me errors. Is there an easier way to add website users through godaddy? Something like the web admin tool that comes with visual studio? Man it is driving me crazy!!!

For the poor man's approach, you can upload a file from the learnvisualstudio.net tutorials (begennirs lesson 09),

Signup.aspx

<%@. Page Language="C#" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server"
</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#F7F7DE" BorderColor="#CCCC99"
BorderStyle="Solid" BorderWidth="1px" ContinueDestinationPageUrl="~/Default.aspx"
Font-Names="Verdana" Font-Size="10pt" Style="z-index: 100; left: 241px; position: absolute;
top: 152px">
<WizardSteps>
<asp:CreateUserWizardStep runat="server">
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<SideBarStyle BackColor="#7C6F57" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" />
<TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="#FFFFFF" />
<SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="#FFFFFF" />
<NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="#FFFFFF" HorizontalAlign="Center" />
<CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<StepStyle BorderWidth="0px" />
</asp:CreateUserWizard>

</div>
</form>
</body>
</html
And here's my Web.config file:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<!--
<trace enabled="true" requestLimit="50" localOnly="false"/>
-->
<compilation debug="true"/>
<roleManager enabled="true"/>
<customErrors mode="Off"/>
<authentication mode="Forms"/
<membership defaultProvider="MySqlMembershipProvider" >
<providers>
<clear/>
<add name="MySqlMembershipProvider"
connectionStringName="MyLocalSQLServer"
applicationName="MyAppName"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
</system.web
<connectionStrings>
<add name="MyLocalSQLServer"
connectionString="Data Source=whsql-v01.prod.mesa1.secureserver.net;Initial Catalog=DB_nnnnn;User ID=user;Password=password;" />
</connectionStrings
</configuration
|||I'd like to know if there is decent user management app for this.

Also when I work with Roles I run into errors. Since I don't have access to the ASP.NET configuration tool I'm notsure if Role Management Enabled is checked on godaddy servers or ifthis would even matter for this app.

Here's my error screen.

Server Error in '/' Application.

TheSSE Provider did not find the database file specified in the connectionstring. At the configured trust level (below High trust level), the SSEprovider can not automatically create the database file.

Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

Exception Details:System.Configuration.Provider.ProviderException:The SSE Provider did not find the database file specified in theconnection string. At the configured trust level (below High trustlevel), the SSE provider can not automatically create the database file.

Source Error:

Line 11: }
Line 12:
Line 13: if (Roles.IsUserInRole("Basic User") == false)
Line 14: Server.Transfer("unauthorized.aspx");
Line 15: }


Source File: d:\Hosting\javagrinder\SecurePage.aspx Line: 13

Stack Trace:

[ProviderException: The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.]
System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(String connectionString) +2466581
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +87
System.Web.Security.SqlRoleProvider.GetRolesForUser(String username) +771
System.Web.Security.RolePrincipal.IsInRole(String role) +272
System.Web.Security.Roles.IsUserInRole(String username, String roleName) +533
System.Web.Security.Roles.IsUserInRole(String roleName) +16
ASP.securepage_aspx.form1_Load(Object sender, EventArgs e) in d:\Hosting\javagrinder\SecurePage.aspx:13
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42|||Hi JavaGrinder, have you tried setting the trust level higher (e.g. "Full")?|||

Lori,

Can you explain how to do that? That may solve another problem I am running into...

Thanks!

|||Ah, that's probably the problem. I get the following error, and am contacting godaddy to see if I can have them unlock this and allow overrides for sites upon request.

I suspect there is something more to it since I'm having troubles adding roles to the tables from their SQL server manager. I can add users and applications from that panel, but not Roles.

Server Error in '/' Application.

Configuration Error

Description:Anerror occurred during the processing of a configuration file requiredto service this request. Please review the specific error details belowand modify your configuration file appropriately.

Parser Error Message:Thisconfiguration section cannot be used at this path. This happens whenthe site administrator has locked access to this section using<location allowOverride="false"> from an inherited configurationfile.

Source Error:

Line 22: </providers>
Line 23: </membership>
Line 24: <trust level="Full"/>
Line 25: </system.web>
Line 26: </location>


Source File: d:\hosting\javagrinder\web.config Line: 24


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42|||

Java,

Let me know how this goes... I am trying to run the reportviewer control from their servers and it gives me permssion errors. I have heard that the reportviewer control requires full trust. Please let me know if they allow you to use full trust.

Thanks!

|||

Oh and by the way Java, I had asked Godaddy before about the trust level and all they kept saying was that I could create folders myself. I don't think they really had a clue what I was talking about... Good luck and let me know how it goes!! I might have to end up swiching host since I need this reportviewer control to work..

Thanks!

|||They say on shared hosting the trust level is set to medium. You have to have a dedicated hosting account to increase it to full.|||Ok, so after talking to godaddy support (useless) I started searching around on google again. I don't know where I got this web.config, but it works for me. Maybe it will work for report viewer.

-Jon

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
<location allowOverride="true"
<system.web>
<!--
<trace enabled="true" requestLimit="50" localOnly="false"/>
-->
<compilation debug="true"/>
<!-- roleManager enabled="true"/ -->
<customErrors mode="Off"/>
<authentication mode="Forms"/>
<membership
<providers
<remove name="AspNetSqlMembershipProvider" /
<add name="AspNetSqlMembershipProvider"

type="System.Web.Security.SqlMembershipProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a"

connectionStringName="MyLocalSQLServer"

enablePasswordRetrieval="false"

enablePasswordReset="true"

requiresQuestionAndAnswer="true"

applicationName="/"

requiresUniqueEmail="false"

passwordFormat="Hashed"

maxInvalidPasswordAttempts="5"

minRequiredPasswordLength="7"

minRequiredNonalphanumericCharacters="1"

passwordAttemptWindow="10"

passwordStrengthRegularExpression="" /
</providers
</membership
<profile
<providers
<remove name="AspNetSqlProfileProvider" /
<add name="AspNetSqlProfileProvider"

connectionStringName="MyLocalSQLServer"

applicationName="/"

type="System.Web.Profile.SqlProfileProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a" /
</providers>

</profile
<roleManager enabled="true">

<providers
<remove name="AspNetSqlRoleProvider" /
<add name="AspNetSqlRoleProvider"

connectionStringName="MyLocalSQLServer"

applicationName="/"

type="System.Web.Security.SqlRoleProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a" /
</providers
</roleManager>
<!--
<membership defaultProvider="MySqlMembershipProvider" >
<providers>
<clear/>
<add name="MySqlMembershipProvider"
connectionStringName="MyLocalSQLServer"
applicationName="MyAppName"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
-->
</system.web>
</location>
<connectionStrings>
<add name="MyLocalSQLServer"
connectionString="Data Source=whsql-v01.prod.mesa1.secureserver.net;Initial Catalog=DB_nnnnnn;User ID=userid;Password=password;" />
</connectionStrings
</configuration>|||

Didn't work for me :( I still get this error...

Required permissions cannot be acquired.

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.Security.Policy.PolicyException: Required permissions cannot be acquired.

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:

[PolicyException: Required permissions cannot be acquired.] System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2737861 System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57[FileLoadException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141 System.Reflection.Assembly.Load(String assemblyString) +25 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3479081 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177 System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +267 System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +36 System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +429 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +73 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +580 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +111 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +54 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31 System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40 System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +120 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42