473,738 Members | 3,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to filter the result thru membership in FormView?

Hi,

I'm new to ASP.Net 2.0, and I have two pages login.aspx which contain
the membership login control with SQL database, and second page
data.aspx which contain FormView.

I need to use SessionParamete r to pass the UserName and do some
filteration to display the required information.

The fields are UserName, Email.

here is my code in data.aspx.c

public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
String UserName = Page.User.Ident ity.Name;
Response.Write( UserName);
}
}

regarding the dayasource code in the formview I wrote:

<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:ASPNETDBConn ectionString %>"
SelectCommand=" SELECT UserName, Email, Phone FROM Data WHERE UserName =
@UserName)">
<SelectParamete rs>
<asp:SessionPar ameter Name="UserName" SessionField="U serName"
Type="String" Size="50" />
</SelectParameter s>
</asp:SqlDataSour ce>

The problem that when I check the session by using
Response.Write( UserName);
it will disply it correctly, but I can't pass it to the SQL and all what
I got is blank page!

Thanx in advance
A. J.

*** Sent via Developersdex http://www.developersdex.com ***
Jul 18 '06 #1
2 1372
Guys, don't you have any solution ????

*** Sent via Developersdex http://www.developersdex.com ***
Jul 20 '06 #2

Up
A. J.

*** Sent via Developersdex http://www.developersdex.com ***
Jul 25 '06 #3

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

Similar topics

11
11990
by: Matt | last post by:
Hi everyone, still pretty new to MySQL. I was wondering if there is a way to automatically filter records based on a mysql userlogin name?? I have serveral databases that I want to combine in order to manage the databases more efficiently. - I'm currently using MySQL 4.1.12 and I'm currently testing 5.0.14 - I have a databases for each user account. - Each database has the same schema and entity relation model.
3
6043
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is "LabLocation_ID". With an existing lab, they then need to add the members for that lab. So, what I am trying to do is the following. With the FormView of the Lab open, the user will click a button to open a FormView (InsertMode) and add a new...
2
2384
by: sck10 | last post by:
Hello, I have 3 objects: LinkButton GridView FormView The LinkButton is used to open the FormView in Insert mode. The GridView provides a list of products. When the "Select" link is
4
4527
by: Fran | last post by:
I recently tried to use code for "Use a multi-select list box to filter a report" from Allen Browne in my database. I was able to add the code and adapt it to my needs, however I am getting an error. I click Ok and the report opens. I look in the design view and the filter is there but the IN equals "" (it is blank, the values are not in there)
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.