Replace LoginName Control With Other Data Fields From Aspnetdb.mdf
Nov 12, 2007
I currently have a LoginStatus and LoginName control on my asp.net 2.0 master page. When successfully logged in a message displays "You are logged in as" LoginName. Since I am using the user's e-mail address as the UserName the message will display as "You are logged in as johndoe@foo.com".
What I want to do is have the message display as "You are logged in as " FirstName LastName. FirstName and LastName are two new fields that I added to the table, aspnet_Users.
What I have done is to use the FormView control to display FirstName and LastName; however this always displays the first record in the aspnetdb database.
Is there a cleaner way (than the FormView control) to display the requested data, using the currently logged in user? I have access to Microsoft Expression Web and Visual Studio 2005, but I prefer Expression Web.
Thank you in advance
View 1 Replies
ADVERTISEMENT
Dec 28, 2006
I am attempting to add additional fields and data to the default users database that is created as a result of enabling roles on my website. Is it possible to add additional data fields to this file? Where can I find the commands to do this?
View 2 Replies
View Related
Oct 22, 2007
Hi all. Looking for information on whether or not the control/navigation bar that appears at the top of the report view can be changed. I am specifically looking to remove it and assign its controls to other .net or html controls/objects. For example, the control bar has the arrow for viewing the next page. Instead of that, perhaps I might like to have a hyperlink etc somewhere else on the page that performs the same functionality. I have searched and searched for information on this but haven't been having much luck. It's kind of a difficult thing to search for due to ambiguous key words "control bar" "navigation" etc.
Not looking for specific info as to how to go about doing it, more like: what is possible and where can I go to find the specifics.
Thanks so much in advance,
Jeff
View 3 Replies
View Related
Feb 2, 2007
I have a table that display large amounts of text in some fields. The table only has two columns (Field Name and Field Data). If the Field data is too large to fit on the same page as the field above it, it pushes to the next page, and then starts printing at the top of that page (the next page down).
I tried setting the "Keep Together" property of the table = True, but this was of no use.
Has anyone found a way to work around this, and if so could you let me know what you had to do. It may just be a SQL Server default setting that cannot be changed. I just want to research all possibilities before reporting back to the users.
Thank you,
T.J.
View 6 Replies
View Related
Dec 22, 2014
I have a text field with about 17,500 rows I need to edit from for example: '1.90X .90' to '1.90X 0.90'? The numbers are various but follow the basic format albiet they may vary to say '22.78X .40'
View 8 Replies
View Related
Dec 19, 2006
My query returns fields that have spaces in the names, for example:
select o.OrderID as 'INVOICE NUMBER', etc..
When I created the DataSet for this query in report designer, it changed all spaces in the field names to underscores, i.e. INVOICE_NUMBER.
This report must be exported to CSV, and the names of the fields (first row in csv) must have the spaces, not underscores. But it appears RS uses the field names (not the names in the column headers of the report table control) as the field names. Is there any way for me to force the field names in the first row of the csv to something other than the field names in the DataSet?
Thanks!
View 5 Replies
View Related
Mar 30, 2007
I have set up roles in my asp.net application, have created my various folders and pages and have the login stuff working nicely, inlcuding displaying the logged-in user's name on screen. What I want to do is read that value (displayed via the LoginName control) as a Parameter in a SqlDataSource query which extracts user-specific data from a sql server 2k datasource. Essentially, if the logged-in user's UserName is jbloggs - I would like to be able to read that into my sql query as @UserName or the like.
If possible, I am trying to do this via the Visual Studio interface, not as code-behind.
Many thanks,
Doc Brown.
View 2 Replies
View Related
Mar 4, 2006
How do I pass the user’s LoginName into the WHERE clause of a SQL query?
I created the following query, but I don’t know how to get the user’s LoginName and pass its value into Param1. Nothing I try works.
SELECT property.propertyid, property.shortdesc, property.shortdesclink, property.text, property.UserID, [User].UserID AS Expr1, [User].Name FROM property INNER JOIN [User] ON property.UserID = [User].UserID WHERE ([User].Name = @Param1)
View 1 Replies
View Related
Aug 8, 2007
I'm trying to automate the creation of a databse and a User/Login but i'm running into problem with a conflict between a new user to which i'm trying to assign a WindowsLogin which is already linked to the dbo. (SQL Server 2005)
Is there a way to reassign the dbo's LoginName to some othe user
Here the code
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'ABC')
BEGIN
declare @cmd nvarchar(max)
set @cmd = 'CREATE USER [ABC] FOR LOGIN ' + @WindowsLogin + ' WITH DEFAULT_SCHEMA=[Shared]'
exec(@cmd)
END
Which give me the error
Msg 15063, Level 16, State 1, Server SR-DEV-GOI1, Line 1
The login already has an account under a different user name.
The script is running under the @WindowsLogin in question !
Thanks All
Gilbert
View 2 Replies
View Related
Sep 10, 2004
How to create a user with name dbo and loginname KING.
So that When I open Users Tab in the database, it should read Name as dbo and lOGIN AS king
View 1 Replies
View Related
Jan 28, 2008
I have just started using SQL Server reporting services and am stuck with creating subreports.
I have a added a sub report to the main report. When I right click on the sub report, go to properties -> Parameters, and click on the dropdown for Parameter Value, I see all Sum and Count fields but not the data fields.
For example, In the dropdownlist for the Parameter value, I see Sum(Fields!TASK_ID.Value, "AppTest"), Count(Fields!TASK_NAME.Value, "CammpTest") but not Fields!TASK_NAME.Value, Fields!TASK_ID.Value which are the fields retrieved from the dataset assigned to the subreport.
When I manually change the parameter value to Fields!TASK_ID.Value, and try to preview the report, I get Error: Subreport could not be shown. I have no idea what the underlying issue is but am guessing that it's because the field - Fields!TASK_ID.Value is not in the dropdown but am trying to link the main report and sub report with this field.
Am I missing something here? Any help is appreciated.
Thanks,
Sirisha
View 3 Replies
View Related
May 12, 2008
I am getting the error:
Cannot open database "aspnetdb" requested by the login. The login failed.
When I browse to my ASP.NET 3.5 LINQ web application on the IIS 6.0 server on Server 2003.
I imagine this is because while I granted SQL Server 2005 login and permissions to my database that the application stores its data in, I did NOT grant any rights to the service account the IIS Application Pool uses for its identity to the aspnetdb database on SQL Server which is where all my roles information is stored at.
My question is what are the MINIMUM permissions needed for this database so it can perform its roles related functions?
I'm using Windows Authentications with the SQL Role provider for authorization.
Thank you.
EDIT: I think I only need to open the aspnetdb database and add my login to the aspnet_Roles_FullAccess role. Is that correct?
View 2 Replies
View Related
Jan 22, 2008
I have followed many tutorials on selecting and replacing text in text fields, varchar fields and char fields, but I have yet to find a single script that will to all 3 based on field type. Let's assume for a moment that I don't know where all in my database a certain value that I need changed resides ... i.e., the data's tablename and fieldname. How would I go about doing the following ... or more importantly, is this even possible in a SQL only procedure?1) Loop over entire database and get all user tables2) Loop over all user tables and get all fields3) Loop over all fields and determine the field type4) switch between field types and change a string of text from 'a' to 'b'Please be gentle, I'm a procedure newb.
View 9 Replies
View Related
May 9, 2008
I created my own table on the ASPNETDB.mdf file.
When i try to insert data on it, i get an exception:
System.Data.SqlClient.SqlException was unhandled by user code Message="String or binary data would be truncated.
The statement has been terminated." Source=".Net SqlClient Data Provider" ErrorCode=-2146232060 Class=16 LineNumber=1 Number=8152 Procedure="" Server="\\.\pipe\33189AFE-4730-4B\tsql\query"....
My C# code to insert:SqlConnection conexao =
new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString);
string query = "Insert Into NovasMaquinas " +"(NomeDaMaquina, FicheiroExecutavel, FicheiroXML, AdminQueSubmeteu, Autor, VmID)" +
"Values (@NomeDaMaquina, @FicheiroExecutavel, @FicheiroXML, @AdminQueSubmeteu, @Autor, @VmID)";SqlCommand cmd = new SqlCommand(query, conexao);
cmd.Parameters.AddWithValue("@NomeDaMaquina", textboxNomeVM.Text);cmd.Parameters.AddWithValue("@FicheiroExecutavel", path + fileUploadEXE.PostedFile.FileName);
cmd.Parameters.AddWithValue("@FicheiroXML", path + fileUploadEXE.PostedFile.FileName);cmd.Parameters.AddWithValue("@AdminQueSubmeteu", User.Identity.Name);
cmd.Parameters.AddWithValue("@Autor", textboxAutorVM.Text);cmd.Parameters.AddWithValue("@VmID", Guid.NewGuid().ToString());
conexao.Open();
//cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery(); //THAT IS THE LINE WHERE THE EXCEPTION IS THROWN
conexao.Close();
Any ideas wath i'm doing wrong?
View 2 Replies
View Related
Jun 30, 2000
Pardon me if this question is too elementary. I am trying to create a trigger that will cause certain datafields to be updated with values from other data fields in the same row when a certain column, created specifically to fire the trigger, is updated. The purpose of this is to reduce data entry by field personnel.I think I have the create trigger statement correct, but I'm a little confused on the update statement.
In a nutshell, how can I write something like:
UPDATE "TABLENAME"
SET DATAFIELD1 = DATAFIELD2
WHERE RECORDNUMBER = (THE SAME RECORD NUMBER)
I do know that I have to ensure that sp_dboption Recursive Triggers value is set to false, thanks.
View 2 Replies
View Related
Sep 4, 2015
I need to create a function that replaces the data in a column with an 'X' based on the LEN of the data in the column. I created one that does a replacement, but it fills the column based on the max data length, and not the current length of the string or integer. An example of what I'm trying to accomplish.
Original data in a varchar(30) column:
thisisavalue
thisisanothervalue
thisisanothervalueagain
shortval
replaced with
xxxxxxxxxx
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxx
My current function is replacing the data like this:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
View 4 Replies
View Related
Dec 29, 2006
How do I tranfer a previous table and its data to the ASPNETDB.MDF in the Web Site Administration tool. I've tried right, but I can't locate the database in the SQL server on my server. help please.
View 1 Replies
View Related
Mar 12, 2008
I want retrieve data from properties field in prifile table in aspnetdb.mdf for multi users,what do i ?
View 1 Replies
View Related
Apr 9, 2007
Hello All,I have a SQLDataSource "sdsX" which has four records. There is a DataList "dlX" which is binded to this SQLDataSource "sdsX". Now I want that my datalist "dlX" take third record of "sdsX" as its first element. Is there any property which can be used.Thanks
View 2 Replies
View Related
Aug 4, 2004
I have a database of about 300,000 records.
The records were imported from a csv file.
One of the fields is duration.
The data in duration are like ths:
1 second: 0:01
26 minutes: 26:00
If i put the format of the field as time, the data are messed up.
0:01 becomes 1 minute.
26:00 becomes 1 day 2 hours.
I currently have duration as text.
How can i use sql or visual basic to replace all the data so that they can have the format "00:00:00"?
(0:01 becomes 00:00:01, 26:00 becomes 00:26:00)
I need the duration in time format in order to be able to make sum calculations.
I will be doing the same calculations every month so i need the above procedure to be able to execute it every time i need to.
Thank you in advace
George
View 10 Replies
View Related
Mar 16, 2012
There are 4 tables in a database. such as university, student, professor and worker. university table contains fields named- university_name, student_name, professor_name and worker_name. and student, professor and worker tables contain person_id and person_name.
Now, I want to replace the student_name, professor_name and worker_name data from university table with student table's person_id, professor table's person_id and worker table's person_id.
View 3 Replies
View Related
Aug 18, 2006
I am working with a database containing time series data. In many, cases there is missing data. For example, while there might be a value for 2001-01-01T23:00:00, there is none for 2001-01-01T23:0100 (one minute later). I would like to replace the missing data with data from the previous record (if the previous record is the same date). Is that possible with T-SQL?
View 6 Replies
View Related
Aug 27, 2006
In this project I m using SQL Server 2005 express edtion.I can run select queries but I couldnt run insert and update query.Is there any protection for adding data to the Sql Server express edition ?
thanks.
View 13 Replies
View Related
Apr 29, 2008
I would like to replace data of some tables from STG to DEV database daily using SSIS package. Should I use "Transfer SQL Server Objects Task" to do that? Thanks.
View 3 Replies
View Related
May 29, 2006
Hello guys,
I would like to execute a t-sql query and replace a string by another in all records.
I did this :
UPDATE myTable
SET myColumn = replace(myColumn,'old string','new string')
The error I get is :
Argument data type ntext is invalid for argument 1 of replace function.
Thank you very much for any help!
Regards,
Fabian
my favorit hoster is ASPnix : www.aspnix.com !
View 5 Replies
View Related
Aug 29, 2006
Hello,
I have a table in witch i would like to replace all the data form one columm following a criteria.
The criteria is:
Where 1010222222 will be 0020222222
So i want to make a script that enables me to substitute all the data in that columm that begin by "101" for "002"
Any help?
Thanks
View 6 Replies
View Related
Feb 29, 2008
Hi, I was wondering if it is posible as in derived columns to replace an input column with the output one in Data Conversion?
What I can see that when a data conversion is done, only we can do it in a new column and not in the same one we are using as input.
Do you know if this it is posible?}
Thanks for your help!
Beli
View 3 Replies
View Related
Jun 14, 2006
I am working with a database named €œDocuments€? that contains 4 categories of text documents, each having its own number designation in an integer datatype column named SectionTypeId:
1 = Text
2 = Report
3 = Background
4 = Index
I would like to create a new column named €œDocType€? in which the integer data type for each document is replaced with a varchar data type letter (1 = T, 2 = R, 3 = B, 4 = I). I was able to easily create the new column and cast the data type from integer to varchar:
--CREATE NEW COLUMN €œDocType€? WITH VARCHAR DATATYPE
ALTER TABLE FullDocuments ADD DocType VARCHAR(1) NULL
Go
--UPDATE NEW COLUMN WITH CAST STRING
UPDATE FullDocuments SET DocType = CAST(SectionTypeID AS VARCHAR(1))
Go
But I have problems with the REPLACE method for replacing the numbers with letters. First I tried this based on the examples in MSDN Library:
--REPLACE NUMBERS WITH LETTERS
UPDATE Fulldocuments REPLACE (DocType,"1","T")
Which produced an error message: €œIncorrect syntax near 'REPLACE'.€?
Thinking that the datatype may be the problem, I tried this to convert to DT_WSTR data type prior to replace:
UPDATE Fulldocuments REPLACE ((DT_WSTR,1)DocType,"1","T")
Which produced the same error message: €œIncorrect syntax near 'REPLACE'.€?
I have never done a REPLACE before, so any suggestions for accomplishing this would be appreciated.
View 3 Replies
View Related
Apr 14, 2004
What is the correct syntax to replace a field data nvarchar(50)
Current data = 0020-10-02
Change = 2003-10-02
Thank you in advance.
View 8 Replies
View Related
Jan 27, 2008
Hi All,
I am placing a Matrix inside the table control for grouping requirements,but when we export the report to the Excel, the contents inside the table cell are ignored. Is there any way to get the full report exported, as per the Requirement.Please help me with this issue.
With Thanks
M.Mahendra
View 5 Replies
View Related
Feb 15, 2008
Hi I have a table named UserMaster having a column Sex for male and female.Sex MaleMaleFemaleFemaleFemale I want to replace all Male with Female and all Female with Male with a single query. Can any one please help me out
View 4 Replies
View Related
Sep 9, 2015
I am writing an SQL query to find an replace data in a column. I have a table that is filled with
C:usersXXXXappdata
C:usersYYYYappda
C:usersZZZZZZappdata
I would like to replace the c:usersXXXXX part with %userprofile%
The end result would be %userprofile%appdata
I know how to dot the replacement in powershell. it's quite easy
-replace "c:users[^]+","%userprofile%"Â Â
Basically how would transfer this into SQL...
View 10 Replies
View Related
Oct 25, 2007
does any one have and example of how to embedd a flash swf file onto a report.??? Is it possable? any examples would be helpful.
View 1 Replies
View Related