Filter By Page.User.Identity.Name

Jun 29, 2007

Hiy all,

I have used the code below to capture the current logged in user into my LoginID Filed in my SQL DB.

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SqlDataSource1.InsertParameters("LoginID").DefaultValue = Page.User.Identity.Name

 End Sub

Now that I have this in my DB I want to create a Gridview that will filter by this LoginID.

So I want to filter all records where LoginID = the currenlty logged in user ie: filter using Page.User.Identity.Name

So in my SQL code I have WHERE loginID = @Currentuser.

VWD now wants me to define a parameter for this Varaibale @Currentuser... So I want to set this to Page.User.Identity.Name.

My Problem is that in the datasource define parameter area I'm not sure what to define this as.

ie: is Page.User.Identity.Name a cookie , control , Query String , session ?

can someone point me in the right direction to what syntax to use?

Ray..

View 7 Replies


ADVERTISEMENT

How To Filter A Report Using An Asp.net Page

Jun 27, 2007

Hi,
I need to filter a single .rdl page in accordance with an option chosen from an asp.net page.
I know how to filter a report within the reporting page. But how can I do the filtering from an asp.net page? For example I have a Report1.rdl that prints out all the locations. I need the same report1.rdl page to print out only for a certain location based on the option I chose from the asp.net page. My asp.net page has 3 buttons. One to for all locations, another for location1, and the other one for location2. Please help. Thanks

View 5 Replies View Related

How Do You Deal With Page Refresh After A Filter Has Been Applied To Original Data?

Mar 14, 2006

I have added a page refresh in combination with 'Command Notification' to ensure that my data is fresh,( it is updated on the sql server database approx. every 5 mins).
However, I also allow filtering on the table contents and every time I refresh the filtering is lost. Is it possible to maintain the filtering through the refresh?
<meta http-equiv="refresh" content="30"/>..<asp:SqlDataSource ID="SqlDataSource1" runat="server" ..SelectCommand="SELECT ... EnableCaching="true" CacheDuration="Infinite" CacheExpirationPolicy="Absolute" SqlCacheDependency="CommandNotification" >
 

View 1 Replies View Related

Implementing A Single Checkbox In A Filter Page In Reporting Services

Aug 29, 2007

I use xml to create a checkbox control on a filter page. The reports runs when it is checked.
However, when the checkbox is unchecked it complains about the parameter missing. Any solutiion?

Tolyaba

View 2 Replies View Related

Login Failed For User 'NT AUTHORITYANONYMOUS LOGON' (but User.identity.name Is Correct)

May 1, 2007

I need help.  The security principal is the correct DomainUser, but the error message says I am not authenticated.
So here is my error Message:
Login failed for user 'NT AUTHORITYANONYMOUS LOGON'. Me.User.Identity.Name=CompanyDomainRyan; System.Security.Principal.WindowsIdentity.GetCurrent=CompanyDomainRyan; HttpContext.Current.User.Identity.Name=CompanyRyan
Generated by:
Dim secPrinc As System.Security.Principal.WindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent
Me.lblError.Text = ex.Message & vbCrLf & vbCrLf & "Me.User.Identity.Name=" & Me.User.Identity.Name & "; System.Security.Principal.WindowsIdentity.GetCurrent=" & secPrinc.Name & "; HttpContext.Current.User.Identity.Name=" & HttpContext.Current.User.Identity.Name
Here is the Connection String:
Private ConnString As String = "Server=10.144.162.111;Database=DNS;Trusted_Connection=True"
 
IIS has 4 websites hosted on it.  The parent level allows anonymous with windows auth off, but the website level has anonymous off with widnows auth and digest.
In IIS, is there a problem with having the parent level anonymous and website level windows auth?

View 1 Replies View Related

Reporting Services :: Multiple Chart On A Report Page And Parameter Filter

Jun 1, 2015

Is it possible to have different chart (having their dataset from same shared datasets) like six on one report, then secondly can they all respond to same parameter filter.

View 3 Replies View Related

Disappearing Parameterised Filters And Filter Joins In Publication Properties Page Of Replication Monitor

Jan 22, 2007

Hi,

We have an issue with our replication configuration when viewed through replication monitor. Parameterised Filters and joined filters don't appear in the gui. However, when we script the publication all the filters are present.

This issue only seems to occur when we have a remote distributor.

I should also point out that we have a merge push topology that uses a custom RMO synchronisation component on a separate server to either the publisher or the distributor. Also all the databases in the topology are called the same name. This has caused us other issues relating to this topology in particular so I raise it here as well although I don't expect it to be the case in this instance.

Any help would be greatly appreciated in clarifying this matter.

View 1 Replies View Related

Filter Tables According To User

Aug 29, 2006

Hi,

Im new to SQL Server and Im having trouble to decide wich is the best way to filter the tables that one user can read and write.

For example the table Sales as a field named Branch (SMALLINT) with values 1 or 2 (the store that made the sale). User "A" can see and write only records where Branch = 1.

Im developing a windows program that shows all the purchased orders in a DataGridView. So should I make the filters (permissions) in the program or in the SQL Server?.

I hope I made my self clear (my english is not so good)

View 5 Replies View Related

Dataset Filter By The Current User

Dec 7, 2007

Is there a way to only return the data that the user is allow to see?

Example:
A student login into the Report Server and open the Class Report It will only display all the classes this student is in.

View 1 Replies View Related

SQL Sever Side Query To Filter For User ID

Apr 23, 2008

I currently have a query in an access database that filters the records in a Sql Linked table for their user ID. So basically i use Environ("UserName") to filter for a field that contains their user name. I want to secure this and put it on the SQL Server so there is no way anyone can see any records other then the ones that are filtered for them. Does anyone know how to do this? I think it will be some SQL query.

I'm still learning sql server 2005.

Thanks.

View 3 Replies View Related

CRM Reports No Longer Able To Filter On User!UserID

Jan 8, 2008



Hello,

I have some reports running CRM data. It's basically a sales dashboard that shows each user their pipeline values. Since each user has rights to see more than just the opportunities they own, I had a filter on the report in the SQL WHERE clause. It said

WHERE
@UserID = systemuser.DomainName.

The @UserID parameter's value was

=User!UserID, which brought back the logged-in user's domain name, which matched the field in my WHERE clause.

Now, in CRM 4.0, to eliminate the need for a VPN to access reports, everyone who accesses a report is logged in as NT Authority Network Service. Does anyone know if there's still a way to access the person's domain identity?

Thanks,

Andy

View 3 Replies View Related

How Do I Return The Identity From Stored Procedure To Asp.net Code Behind Page?

Jun 2, 2006

how do i return the identity from stored procedure to asp.net code behind page?
CREATE PROCEDURE [dbo].[myInsert] ( @Name varchar(35),   @LastIdentityNumber int output)AS insert into table1 (name) values (@name)
DECLARE @IdentityNumber intSET @IdentityNumber = SCOPE_IDENTITY()SELECT @IdentityNumber as LastIdentityNumber
code behind:
public void _Insert(
string _Name,
{
DbCommand dbCommand = db.GetStoredProcCommand("name_Insert");db.AddInParameter(dbCommand, "name", DbType.String, _userId);
db.AddParameter(dbCommand, "@IdentityNumber", DbType.Int32, ParameterDirection.Output, "", DataRowVersion.Current, null);
db.ExecuteNonQuery(dbCommand);
int a = (int)db.GetParameterValue(dbCommand,"@IdentityNumber");
whats wrong with to the above code?
 

View 2 Replies View Related

Filter SqlDataSource Select Based On Membership User Name

Jul 11, 2006

I am running into an issue trying to declaratively set up a SqlDataSource.  I want to be able to filter some of my queries based on the user that is currently logged into the web site.  I want to do it Declaratively as that's one of my favorite 2.0 features.Is there any way to do this with the Membership information?  I know I can use the code behind to set the parameter, or store the User Name in Session Variable, and use a <asp:SessionParameter> but I think there should be a way to bind directly to the Membership user...Am I missing another option, or is there no built in way to do this?  Any other suggestions...Thanks

View 1 Replies View Related

Filter SQL Server Data By User With An Micmicrosoft Access Front End

Sep 20, 2006

I am in the process of migrating 40 access databases to SQL Server and still use an access front end.All of these databases are Identical in structure and purpose. The goal is to centralize all of the databases backends into one Sql server database, but the data needs to
stay seperated by each location(user). I was able to add a location feild to all of the tables to keep the data seperate. Then I imported three of the locations data for testing. I would like to know how could I filter the data on the access frontend, so that it would ask the user for their location and only allow the user to access, update, and delete that Locations data ?

View 4 Replies View Related

In A Data Model, How Do I Filter Rows Based On The Identify Of The User???

Jun 21, 2005

Good morning,

View 7 Replies View Related

Get User Identity With Sp ??

Dec 3, 2005

Hi,
Is there a way to get name of user in WinNT (or server logged name) with stored procedure?

I just want to create trigger that will indentify user who created row.

Thanx

View 1 Replies View Related

Add Identity Increment Per User

Sep 11, 2007

HiI have a Jobs Table: Job_ID,User_ID,Job_Info,...Job_ID is the Primary Key.I want to add [Job_ID_PerUser] so I wiil get:Job_ID Job_ID_PerUser User_ID1 1 A2 1 B3 1 C4 2 A5 3 A6 2 CThanks

View 4 Replies View Related

User.Identity.Name Parameters

Dec 3, 2007

 Hi,I have an on screen control to select data from a table. Here are the parameters for the select:           <asp:Parameter DefaultValue="bezlan" Name="recievername" />
            <asp:Parameter DefaultValue="bezlan" Name="recieversname" />this works perfectly if I sign in as bezlan           <asp:Parameter DefaultValue="User.Identity.Name" Name="recievername" />
            <asp:Parameter DefaultValue="User.Identity.Name" Name="recieversname" /> this doesnt pick up any data at all if I sign in as bezlan.Why is this? Is there a special bit of code I need for parameters?Thanks,Jon 

View 6 Replies View Related

How To Ref User.Identity.Name In TSQL

May 16, 2008

Hello everyone,
In SQL Query I need to update a field to my ASP.NET app which has a variable User.Identity.Name() where it contains the Form Authentication of current logon user, SQL has the suser_name() function but this is not what I needed because it returns the user accessing the Database. 
UPDATE [tblData] SET [UserUpdated] = User.Identity.Name()   <= this failed because SQL doesn't recordnize the User.Identity.Name() function.  Is there any method I can use to achieve this?
Thanks in advance. 
 
 
 

View 2 Replies View Related

Question With SQLDATASOURCE And User.identity.name

Feb 20, 2007

is there a way that I can use the sqldatasource with a form view where my sqldatasource select statement is like this
select * from tblUsers where vcUserName=@vcUserName
<selectparameters>
<asp:Parameter Name="user.identity.name" Type="String />
</selectParameters>

View 1 Replies View Related

Problem With Identity User In A Report

Apr 4, 2007

Hi,



I use forms authentication with my Report manager. The problem is that I can't display the same information to all the users into the report. For example, in my report, i have one dataset that give me a list of all the store of a compagny. And i have to display only the store onto the user is working. If the user is a boss, he can see the information of all the stores. So i have to know in my report what is the login he uses in the form authetication and i don't know how to do.



Excuse me for my bad english and thank you.



Regards,

Shaouk.

View 3 Replies View Related

Label Showing User.identity.name In Detailsview

Aug 30, 2007

Hi, any suggestions on why my label doesn't show the current user.identity.name when used in a detailsview (header-field or insert-field), when it works just fine placed directly on my page ?
Please help ! (I want to bind myLabelX.Text to a db-table, but it contains no value..)
codebehind  : 1 using System;
2 using System.Data;
3 using System.Configuration;
4 using System.Collections;
5 using System.Web;
6 using System.Web.Security;
7 using System.Web.UI;
8 using System.Web.UI.WebControls;
9 using System.Web.UI.WebControls.WebParts;
10 using System.Web.UI.HtmlControls;
11
12
13 public partial class Test_2 : System.Web.UI.Page
14 {
15
16 protected void Page_Load(object sender, EventArgs e)
17 {
18 if ((!IsPostBack)) myLabelX.Text = User.Identity.Name;
19 }
20
21 }
 

View 3 Replies View Related

Checking Last User Identity On Remote Server

Oct 12, 2006

Is it possible to get the latest inserted Identity value on a remote server?

(The following gives a NULL result:

select ident_current('[my_linked_server].thedatabase.dbo.thetable')

)

View 4 Replies View Related

HttpContext.Current.User.Identity.Name Blank ?

Mar 2, 2007

I have implemented the forms authentication method using  MSDN web site http://msdn2.microsoft.com/en-us/library/ms160724.aspx

and now i want to modify that code

so when i used

Dim UserName as string =HttpContext.Current.User.Identity.Name

from the vb.net code behind

it gives me ss as blank value ?

but the same code i used from the normal web site its gives me the

"SER1Administrator" value for that string(current user)

so my problem is why is that code not working for the report server sample project ,which microsoft provided ?

do i have to change any configuration settings ?

please help me .......i am in trouble ?

(what i really want is i need to get the username from the active page directory? wheather this username exist from the active page directory.)

 

regards

sujithf

 

 

View 1 Replies View Related

Login Failed For User 'sa' ,connecting From Asp.net 2.0 Page

Mar 4, 2008

Hello,
i am using sql server 2005 and installed in mixed mode withe user name sa and password #sa
and from Sql Server Surface Area Configuration i select the Using both TCP/IP and named pipes for remote settings under Database Engine
version is [@@version]
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Evaluation Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

My os is Xp with service pack2

I am using asp.net 2.0 and using connection string in web.config
<configuration>
<appSettings>
<add key="brian" value="server=SOURAV;uid=sa;pwd=#sa;database=test"/>
</appSettings>

SOURAV is my local Database Server name.

I can connect server with the user name password from the SQL Server Management Studio,
But the problem arise when i hit con.open() from asp.net page

error message show login failed for user 'sa'

Please help how to solve,
Thanks in advance
Sourav

View 1 Replies View Related

HttpContext.Current.User.Identity.Name Form SQLDataSource

Apr 21, 2007

Hi,How do I get hold of the HttpContext.Current.User.Identity.Name from within an sqldatasource? I want to create a WHERE clause that says WHERE UserName = @UserName and the @UserName parameter be filled with the current user name. I would be able to do this in code, but I don't know how to get at this information from within a datasource. At a guess I tried to use the Cookie option from the drop down list, and use the name of the FormsAuthentication Cookie, but this didn't work. Is there a way I can do this? If so how? I don't want to resort to using a hidden field or anything like that if I can help it. Many thanks, Steve 

View 2 Replies View Related

Gridview Select Statement With User.identity.name In The Where Clause

May 5, 2008

Hello everyone,
I have a view, NAS_vPosition that has a coloumn vLogin_Acting and I want to use the user.identity.name to select the row from this table that matches.
So far i have tried:
SelectCommand = "Select * FROM NAS_vPosition WHERE vLogin_Acting = ' <%=User.Identity.Name %> ' "
with no success.
Any help is appreciated

View 6 Replies View Related

Select Based On User Identity Name Included In Insert Into Second Table

Aug 25, 2006

I am having issues getting this to work.  I have the user login to a page to
put in a request for vacation.  When they login, I have a label that isn't
visible that is equal to their User.Identity.Name.
I select the user from the employee table where the username = the label User
Identity Name and pull in the emp_id which is the primary key that identifies
the user. 
I need to insert the request into the request table with the emp_id from the
select statement, without showing the em_id on the screen.  I tried using a
hidden field and assigning the emp_id as the value, but it isn't working. 
Not sure if this is the best way to do this.  Really new to ASP.NET 2.0 so I
really appreciate any help.
Thank you!

View 12 Replies View Related

How To Propagate User Identity Form Application Server To Database

Apr 21, 2008

Hi All,

I am new to MS SQL SERVER 2005.
My web application using SQL Server 2005 as back end database to store all the information.
I am using connection pooling to get connection form db.
But my fron end user( user who logged in into webapplication) lost his identity b'coz for database user is application server.
Now I wanna to track front end user in db.

In oracle I can do it by using CLIENT_IDENTIFIER. But in sql server I don't know how to do it.

in oracle i can do it as below
public void setIdentity(Connection conn, String identity) {
PreparedStatement ps;
try {
ps =
conn.prepareCall("begin dbms_session.set_identifier(?); end;");
ps.setString(1, identity);
ps.execute();
ps.close();
} catch (SQLException e) {
// Handle the exception
}
}
<!--[if !supportLineBreakNewLine]-->
once the transaction is complete, the application should reset the identity as follows:

public void clearIdentity(Connection conn) {
PreparedStatement ps;
try {
ps = conn.prepareCall("begin dbms_session.clear_identifier(); end;");
ps.execute();
ps.close();
} catch (SQLException e) {
// Handle the exception
}
}
<!--[if !supportLineBreakNewLine]-->
Please guide me for same.

Thanx in advance.

Bhadu<!--[endif]-->

View 6 Replies View Related

Want To Use Parameters To Filter For Dates Between Two (parameter, User-input) Dates

Mar 2, 2006

SQL 2005 Dev

How can I do this with Parameters? I can get a single parameter to filter for a single date (or even a combo list of the dates in DB). But I want my parameters to interact so that they specify a range. Is this possible?

View 3 Replies View Related

Automatic Select Filter (something Like Global Table Filter)

Apr 15, 2008

Hello,

Here is my problem:


I use SQL Server 2005. I have approx. 50 tables in my database and 30 of them have a filed named "CompanyID". Example:
create table A (ID int identity, NAME varchar(100), COMPANYID int)create table A (ID int identity, REF_ID int, FIELD1 varchar(100), FIELD2 varchar(100), COMPANYID int)

Also there are nearly 200 stored procedures that read data from these tables. Example:
create procedure ABCasbegin /* some checks and expressions here ... */ select ... from A inner join B on (A.ID = B.REF_ID) where ... /* ... */end;

All my queries in the Stored procedure does not filter the tables by CompanyID, so they process the entire data.

However, now we have a requirement to separate the data for each company. That means that we have to put a filter by CompanyID to each of those 20 tables in each query where the tables appear.

Firstly, I put the CompanyID in the context so now its value is accessible through the context_info() function. Thus I do not need now to pass it as a parameter to the stored procedures.

However, I don't know what is the easiest and fastest way to filter the tables. Example:

I modified the above mentioned procedure in the following way:
create procedure ABCasbegin /* some checks and expressions here ... */
-- gets the CompanyID from the context: DECLARE @CompanyID int; SELECT @CompanyID = CONVERT(float, CONVERT(varchar(128), context_info()))
select ... from A inner join B on (A.ID = B.REF_ID) where ...
and A.COMPANYID = @CompanyID and B.COMPANYID = @CompanyID /* ... */end;

Now I have the desired filter by CompanyID. However, modifying over 200 stored procedures is rather tedious work and I don't think that this is the best approach. Is there any functionality in SQL Server that can provide the possibility to put an automatic filter to the tables.
For example: when I wrote "SELECT * FROM A", the actual statements to be executed would be "SELECT * FROM A WHERE CompanyID = CONVERT(float, CONVERT(varchar(128), context_info()))".

I was looking for something like "INSTEAD OF SELECT" triggers but I didn't manage to find any answer.

I would very grateful is someone suggests a solution for something like "global table filter" (that will help me make an easy refactoring)?


Thanks in advance.

Best regards,
Beroetz

View 5 Replies View Related

Reporting Services :: All Record Are Displaying On One Page - How To Display Page By Page

Nov 11, 2015

I have created one reports but all the records are displaying on one page.find a solution to display the records page by page. I created the same report without group so the records are displaying in page by page.

View 3 Replies View Related

And/or Filter Field Not Enabled In The Group Filter Tab

Jan 26, 2006

Howdy,

I have a table that has a group. In this group, I want to filter by 2 different expressions, concatenated with an OR. BUT I can't change the "And/Or" column value for the first entry because it is grayed out. The column will automatically change to an OR value if both my expression column fields are the same (which I don€™t want) but if I put any other value in to the expression field of the second row, the "And/Or" field of the first row automatically changes to an AND.

PLEASE! How do I get the And/Or field "ungrayed" so I can change it to what I want?

The 2 filters I and using check the UserID = to the user, and the other is checking a count to get the Top N 1. (So just showing the current user and the top producer)

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved