Security :: Extracting Custom Values From The Aspnet_profile Table And Placing Them In A Dropdownlist
May 17, 2010
I've recently used the CreateUserWizard to add firstname, middlename and lastname to my aspnet_Profile table. I was wondering how I would go about placing these values in a dropdownlist (ddlEmployees) so that I may wind up with a list displaying these values concatenated, eg. Mary Anne Brant, Joseph Ezra Shultz etc. That's the firstname, middlename and lastname from the profiles table.
View 9 Replies
Similar Messages:
Jul 27, 2010
I am using profiles it works fine but it is not saving in aspnet_profile table besides using save method
In Web Config:
<profile enabled="true" defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="dd"
applicationName="AJAXEnabledFor Master Page"/>
</providers>
<properties>
<add name= "FirstName" />
<add name= "LastName" />
<add name= "Address1"/>
<add name= "Address2"/>
<add name= "City"/>
<add name= "State"/>
<add name= "Country"/>
<add name= "PinCode"/>
<add name= "Contact"/>
</properties>
</profile>
In Code Behind File
if (CreateUserWizard1.ActiveStep.Title == "Complete")
{
Roles.AddUserToRole(CreateUserWizard1.UserName, "Guest");
ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);
WizardStep Details = CreateUserWizard1.FindControl("Details") as WizardStep;
p.FirstName = ((TextBox)Details.FindControl("TextBox1")).Text;
p.LastName = ((TextBox)Details.FindControl("TextBox2")).Text;
p.Address1 = ((TextBox)Details.FindControl("TextBox3")).Text;
p.Address2 = ((TextBox)Details.FindControl("TextBox4")).Text;
p.City = ((TextBox)Details.FindControl("TextBox5")).Text;
p.State = ((TextBox)Details.FindControl("TextBox6")).Text;
p.Country = ((TextBox)Details.FindControl("TextBox7")).Text;
p.PinCode = ((TextBox)Details.FindControl("TextBox8")).Text;
p.Contact = ((TextBox)Details.FindControl("TextBox9")).Text;
p.Save();
}
View 1 Replies
Jun 26, 2010
I am retrieving user data from aspnet_user table from aspnetdb database but I also want to retrieve data (such as first name, last name, email, address etc) from aspnet_profile table. I am using dropdownlist which retrieves user names from the aspnet_user table.
retrieve user data from aspnet_profile instead?
My code is as followed:
[Code]....
[Code]....
View 1 Replies
Jul 29, 2010
Is it possible to setup the CreateUserWizard to check for a duplicate entry in the aspnet_profile table (for a custom field) before the new user is created? For example, if I added a phone number field and wanted to make sure nobody else could create an account using that same phone number if a user already has an account with that phone number in the aspnet_Profile table's PropertyValuesString row?
View 10 Replies
Feb 5, 2010
I have the aspnet membership on my own sql database, I am trying to add the user's first and last name into my sql select query. How can I do it?
View 3 Replies
Nov 19, 2010
I need to write a query to populate a gridview with minimum rates in ascending order for a month from three tables.For example i have three tables A,B,C as follows
TABLE A TABLE B
TABLE C
Id id id
Quote_no Quote_no Quote_ no
Name Rate1 Equip_name
Rate2 E_rate
Date R1_rate
R2_rate
Date
Now if the data is as follows
I need to get the Name from Table A ,minimum Rate1 and Rate2 values for a month in a dropdownlist from date field from Table B and the corresponding minimum rate(E_rate) for Equipment E1 and E2 only from Table C for the month in ascending order group by Name.
TABLE A
id
Quote_no
Name
1
101
XYZ
2
102
ABC
TABLE B
id
Quote_no
Rate1
Rate2
Date
1
101
105
200
12/11/2010
2
102
90
210
15/11/2010
TABLE C
id
Quote_no
Equip_name
E_rate
R1_rate
R2_Rate
Date
1
101
E1
60
0
0
12/11/2010
1
101
R1
0
110
0
12/11/2010
1
101
E2
80
0
0
12/11/2010
2
102
R2
0
0
300
15/11/2010
2
102
E2
100
0
0
15/11/2010
2
102
R1
0
60
0
15/11/2010
2
102
E1
230
0
0
15/11/2010
View 9 Replies
Sep 13, 2010
How would I add a (dropdown) list of available values for a custom server control property?
(Just like 'Visible' property of most controls has valid values of 'True/False' and nothing else can be entered or selected)
View 3 Replies
Aug 16, 2010
I have wrothe this following code for placing a picture in Table Row but it is not working.
View 3 Replies
Nov 6, 2010
I have a datalist that is populated via and SqlDataSource. Code is VB
I am trying to extract two Values from the Item Templete and add them together. Then I want to add a new Label to the item template with the sum of the two added values.
I am able to to this using a GridView but no success with the datalist
My form code:
<asp:Label
ID="SDLabel"
runat="server"
Text='<%# Eval("SD") %>'></asp:Label><br
/>
SDT<asp:Label
ID="SDTLabel"
runat="server"
Text='<%# Eval("SDT") %>'></asp:Label><br
/>
SDS:<asp:Label
ID="SDSLabel"
runat="server"></asp:Label><br
/>
My VB Code behind Starts out:
[Code]....
View 7 Replies
Aug 17, 2010
I have a requirement wherein a SQL query will be given in a text file.
The text file has to be read , the SQL query needs to be parsed and the column names, table names and where clauses have to be extracted and inserted into separate tables.
DB: Sql Server
View 2 Replies
Sep 15, 2010
I want to filter the table in my Listview (mvc2) using values from a dropdownlist shown at the top of the page. The values in the list are hard coded. Next to the dropdownlist I got a "Filter" button that calls the filter method on the controller / How can I pass the selected value from the list to the controller? for now I'm using a classic asp:dropdownlist
[Code]....
View 2 Replies
Jan 12, 2011
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Test1._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >[code].....
I had created the database called train. A train database has a two tables
View 3 Replies
Dec 16, 2010
I have an html table with rows and cells. And I have dynamically created a label and would like to assign the label to one of the cells of the table. What I am doing is I have a JavaScript which executes a code behind method and it would not accept an already created asp.net label. So I have created the asp.net label programmatically but cant assign it to the table to display the text value of the label. Below is the code:
[System.Web.Services.WebMethod] public static void EndCandiateTest(){
try { totalTestMarks = ts.RetrieveResults();
grade = tsp.RawScoreAndGrade(totalTestMarks);
remarks = tsp.ScoreInterpretation(totalTestMarks);
testResults = "Raw Score: " + totalTestMarks.ToString() + "
Grade: " + grade + " Remarks: " + remarks;
ts.ShowResults(testResults);
} catch (Exception e) {
} }
protected void ShowResults (string results). I want to display this label in an already existing html table.
messageLabel.Text = results;
View 3 Replies
Jul 28, 2010
I'm coding my first VB web application, which allows a user to input an order number and pull up invoice and shipping data linkd to that order number.
I have the first bit down and working, where the existing data in the database is displayed in the GridViews. One of the GridViews is set up to allow data editing, and I have syntax set to make the row editable, but I'm struggling with getting the "Update" link/functionality to work. I want to assign the values in each cell to an object (ie. 'dgInvNumber' for Invoice Number), but everything I've tried (been doing a ton of Google searching for help, but no luck yet) keeps giving me an "Object reference not set
to an instance of an object" error when I click the Update link for the row of data being edited.
At this point, I don't know what syntax to use to get the edited values out of the GridView row and assigned to objects for each cell (I have a total of 10 cells that can be edited in a row).
For background info, the GridView is set up with Bound Fields. I'm using Visual Studio 2005. Alot of places I've looked talk about TextBox controls and using FindControl. Also seen some places talk about DataBoundLiteral Controls. I tried the latter with no luck (still getting error). For TextBox controls, I don't understand how to use that part, since it mentions referencing the TextBox controls declared in the EditItemTemplates of the TemplateField column fields in the GridView control. But I didn't set up anything in the EditItemTemplates (that I know of).
View 1 Replies
Aug 13, 2010
how can add another dropdown inside the login control and authenticate the user on the basis of user name,password,and location.
is there any other way?
View 5 Replies
Sep 19, 2010
I created a custom membership provider in my ASP.NET 4.0 web site, stored in App_Code, and referenced in my web.config.
However, it doesn't appear to be pulling values out of web.config during initialization.
The code was taken from [URL] , and the only modifications were changing "connectionStringName" here to the name of my connection string:
[Code]....
The connection string always comes back as nothing in this line:
[Code]....
No matter what I change the password format to in web.config, the default value here is always used:
[Code]....
So to me it's pretty clear it's not pulling out values for some reason. Here is the reference to the membership provider in web.config.
[Code]....
View 6 Replies
Jun 27, 2010
I recently read Scott Mitchell's article series "Examining ASP.NET's Membership, Roles, and Profile". In Part 6 [URL] It says "to store additional, user-specific fields...If you are using the SqlMembershipProvider, this would mean creating an additional database table that had as a primary key the UserId value from the aspnet_Users table and columns for each of the additional user properties."
I created a table named Thread to store some specific users information and comments they make. I set the ThreadId as the primary key and the UserId as the foreign key to the UserId in aspnet_Users table. But when I run the application and use a user's account to submit a comment, there is an error in my Comments.aspx.vb page "Cannot insert the value NULL into column 'UserId', table 'ASPNETDB.dbo.Thread'; column does not allow nulls. INSERT fails.The statement has been terminated."
How can I make the logged-on user's UserId inserted into the Thread table when storing the user's other data information?
View 6 Replies
Jan 26, 2011
I have a GridView control that has a SQLDataSource.
The GridView provides me with a list of musical artists (from the tblArtists)
In the Grid, I have a field, FKGenreID, that is a Foreign Key value for music Genres.
(An example of the data in that field would be "7", which upon lookup would mean Classical in the
tblGenreList table.)
What I'd like to do is add a DropDownList control that looks up the tblGenreList table and populates the DropDownList with the ID and Description from the tblGenreList Lookup table.
Now the tricky part is that if the GridView field (FKGenreID) has a value, then I'd like the corresponding Genre Description to be displayed in the DropDownList
Alternately, if there is no value for FKGenreID in the GridView, then I'd like the DropDownList to show that nothing was selected, but have the list of Genres available.
Most importantly here, when the user makes a selection, I'd like the GenreID (from the DropDownList) to be entered into the FKGenreID field in the GridView field.
My thought is that a gridview record may or may not have a value in the FKGenreID field. Either way, the DropDownList is bound to that field. The DropDownList would display a list ofGenre Descriptions for the user to select from. Upon selection, the GenreID column of the DropDownList becomes the value in for the FKGenreID field in the GridView.
Is this possible?
In case it matters, I'm using ASP.NET 4, Visual Studio 2010, and coding in VB
View 1 Replies
Jan 4, 2011
I merged my website tables with ASPNET.db tables using aspregedit.exe. Problem is the user id in aspnetdb user table differs from userid in website table in datatype. One is Uniqueidentifier and the other int. I tried changing the datatypes accordingly, but unsuccessfully. Do I have no option than to re create all my website tables to match the data type in aspnet.db database?
UserId in custom website table is int. UserId in aspnetdb is uniqueidetifier. UserId in custom website database is the primary key and FK in more than one tables, so thats extensively used in the custom database.
View 3 Replies
Apr 23, 2010
I am trying to use a second (custom) table to extend my users profile info. This table is in the same database as the 'aspnet_Users' table but has a different name. I create a FK relationship between the 'aspnet_Users' table and my custom table. Here is my web.config code:
<profile defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ConString_SQLConnectionString"
applicationName="/" />
<add name="MyCustomProfile"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ConString_SQLConnectionString"
applicationName="/"
table="MyProfileTable_Employees" />
</providers>
<properties>
<group name ="MyProfileInfo">
<add name="FirstName" type="string" defaultValue="[null]" customProviderData="FirstName;nvarchar" provider="MyCustomProfile" />
<add name="LastName" type="string" defaultValue="[null]" customProviderData="LastName;nvarchar" provider="MyCustomProfile" />
<add name="EmployeeNumber" type="int" defaultValue="[null]" customProviderData="EmployeeNumber;int" provider="MyCustomProfile" />
</group>
</properties>
</profile>
I have the table "MyProfileTable_Employees" poplulated with data the 'userid' matches to the aspnet_Users table. In my web application (vb), when I type in Profile.MyProfileInfo, there are no custom fields. Actually, when I type profile., there are no profile related entries. What am I missing here? Am I miss-interpting what a custom profile provider is?
View 2 Replies
Nov 23, 2010
I have a list of user , each user have a profile , contain FullName , stored in ASPNET_PROFILE .
Problem is how can i query them list (username , Fullname ) , order by FullName .
I'm using Entity Framework
View 2 Replies
Jun 14, 2010
I seriously want to learn how to create a custom server control, for that I made a requirement for myself, but lost on how to accomplish it.
Requirement -I want to create a cascading dropdownlist control - which should have following properties -1) ConnectionString - used to get data for the 1st dropdown from database, and also it is used by 2nd DropDown to get data.2) 1stSelectCommand - Used by the 1st DropDown to get data from the database.3) 2ndWhereCommand - used by the 2nd DropDown - uses the selected value from the 1st DropDown in the where clause to get data.
Methods - 1) DropDown1_SelectedIndexChanged()2) DropDown2_SelectedIndexChanged(3) CustomCascading_Changed() - this happens when any of the DropDowns index changed.
PS - This is a random requirement, of course it got nothing to do with any project or real time.I want to learn, so i incorporated basic concepts like Data Access, Custom Methods, Properties etc.PPS - I know how to create basic custom server control, so plz dont forward me links to how to create basic custom server controls. But in case with extrordinary links.
View 6 Replies
Oct 9, 2012
UsingĀ dropdown in gridview and bind the values in dropdown then based on dropdown display the value in another column.
View 1 Replies
Jun 28, 2010
I would like to store some business flags (like: isFavorite, isOnLive etc.) per an html table row that won't be visible to user.
In practice, I have a simple ADO.Net DataTable on my code-behind which is used as a data-source for a asp.Net GridView control.
This table contains some business flags on its 0th, 1st, 2nd columns.
I need to store those columns on the rendered HTML of the grid-view -so that I can reach them via JavaScript- but I do not want them to be visible.
View 2 Replies
Apr 21, 2010
I've recently started tinkering with ASP.NET MVC, but this question should apply to classic ASP.NET as well. For what it's worth, I don't know very much about forms authentication and membership providers either.
I'm trying to write my own MembershipProvider which will be connected to my own custom user table in my database. My user table contains all of the basic user information such as usernames, passwords, password salts, e-mail addresses and so on, but also information such as first name, last name and country of residence.
As far as I understand, the standard way of doing this in ASP.NET is to create a user table
without the extra information and then a "profile" table with the extra information. However, this doesn't sound very good to me, because whenever I need to access that extra information I would have to make one extra database query to get it.
I read in the book "Pro ASP.NET 3.5 in C# 2008" that having a separate table for the profiles is not a very good idea if you need to access the profile table a lot and have many different pages in your website.
Now for the problem at hand... As I said, I'm writing my own custom MembershipProvider subclass and it's going pretty well so far, but now I've come to realize that the CreateUser doesn't allow me to create users in the way I'd like. The method only takes a fixed number of arguments and first name, last name and country of residence are not part of them.
So how would I create an entry for the new user in my custom table without this information at hand in CreateUser of my MembershipProvider?
View 2 Replies