I ma sure this is easy but asp.net is new for me. Anyway I'm trying to collect a username and put it into a SQL database. I collected the username just fine:
Code:
[code]....
Then I tried numerous ways of trying to put it into a text box with no luck:
I've been scouring the forumsa and tutorials and I think I'm close. I'm trying to collect the username ofthe user connecting to the webapage (this is an intranet app). My confusion is where you put what. On the default.aspx.vb I have a proteced sub page load and I have this code in it:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' Get the Logged on user ' Make sure Anonymous is not checked in IIS Manager ' otherwise this may be empty
[Code]....
I tried to collect to @Logon_User but the username is never populated. I have anonymous access unchecked and windows authentication checked, I have <authentication mode="Windows"/> in my web.config.
A site that utilizes Windows Authentication.It accesses the LOGON_USER variable to pull the domain and user.It works fine in the development environment.It works fine on one of my servers.We are in the process of setting up a new server for this application to be hosted on.When I setup the new server,the LOGON_USER is always empty for remote computers.Windows Auth is turned on.I have tried it with Anonymous Access on (how the current server is setup) and also off.If I remote on to the server and run the application locally,LOGON_USER is filled.When I access the site via IE from a remote machine,it prompts three times and then fails.Even if I key in credentials in the Windows prompt.nothing
I have in my database the News Table which consist of => Id, Title, txt . I need to be able to get a description text from the whole text which exist in txt Field , but without any codes like <...> , just a pure text !! how can I do this?
I have an old database that still contains depreciated Text fields. I need to pull from these fields and display the results. You would think this should be easy... First my select statement caused a problem:
Code: SELECT DISTINCT ..., CustomerInstructions, ... FROM Orders where CustomerInstructions is a Text field.
The error I get: "The text data type cannot be selected as DISTINCT because it is not comparable." A quick search shows I can cast the text field as a varchar(max).
Code: SELECT DISTINCT ..., CAST(CustomerInstructions AS VARCHAR(MAX)), ... FROM Orders
Now I get an error while trying to load the instructions into a text box: "Specified argument was out of the range of valid values. Parameter name: index"
Not sure what the problem is here. I have text and a text box. What's with the "out of range" crap?
I'm not using any built in authentication mechanism, just building a simple intranet site that requires logon.BUT i was asked to retrieve the current windows logon name of the user, and authenticate him with this information.When reading the Request.ServerVariables("LOGON_USER") information from my box, everything runs fine. But this value is always blank when the application is running with IIS on my server.
clarify: i am using a virtual keyboard that has to work on deferent text fields, and deferent pages, every time i click on a text field it sould pop up and every key i press i need to show on the text field....the problem, as every one knows, is to bind a deferent text field to the virtual keyboard, And as i said, also, to use it on deferent pages without rewriting the keyboard code for every page again and again, some thing that will not do... still can not give any code as there is no code to give, so there is no code...
i don't have code to show becouse i am trying to figure out how to do this and not showing a problem...
Background: I have an aspx file that holds a keyboard div and a hidden TextArea or an Input type=hidden (not decided yet). This page is a user control so it cen be used in all the pages that needs it...
What i am tring to do: Using JQuery bind('focus',...) method to bind any field in a certian aspx page (not the keyboard UC itself) to the hidden text field, i want that every thing i click on the keyboard will show in the text field that is on focus....
Can i relate in JS/JQuery to a field that is in a different page, will it recognise it? how can i do the bind, how can i transfer text from one field to another? if there a better way to do this, i will be happy to hear about it...
I know that this is easy for those that know but alas this is not me ;)
I have a multi part form that is going to write to a dB.
As a point of reference I can offer [URL](i.e., the quote process) as a model for my project.
I need to write a record on the first page and then use the auto number generated from this to populate the child records with the parent's key field.
What I was hoping to do is write the record and then send the data from the dB to the second form. Iwill then need to repeat this process for the children of the child
I am only moderately familiar with ASP.net
one thing to add is that i am not forcing the user to create an account in order to maje the initial inquiry, only if they wish to reaccess theinformation at a later date.
When adding list item the Value field is being set to the Text field. Initially I though the problem was related to the input parameter for the primary key ( group_type_id ) as it is configured as OUTPUT variable.
Interesting enough, when I Watch all of the values, everything is correct. So for example, I'll watch these:
ddr["group_type_name"] comes out as "Dept" ddr["grouptypeid"] comes out as 4
When the item is created however,
itms.TEXT = "Dept" itms.Value = "Dept" <-- THIS IS THE PROBLEM
I'm at a loss why the listbox values are being set to the text values when I can clearly see the data reader values are correct. ?
I want to parse an address from a text field. for example
textbox data = 123 test street, mountain view, CA 91302 Dim address = Address.text parse(address) to Address1 Address2 City State Zip
I found someones sample code, but it doesn't work all that well. here it is non the less
Public Function parseAddress(ByVal input As String) As Collection input = input.Replace(",", "") input = input.Replace(" ", " ") Dim splitString() As String = Split(input) Dim streetMarker() As String = New String() {"street", "st", "st.", "avenue", "ave", "ave.", "blvd", "blvd.", "highway", "hwy", "hwy.", "box", "road", "rd", "rd.", "lane", "ln", "ln.", "circle", "circ", "circ.", "court", "ct", "ct."} Dim address1 As String Dim address2 As String = "" Dim city As String Dim state As String Dim zip As String Dim streetMarkerIndex As Integer zip = splitString(splitString.Length - 1).ToString() state = splitString(splitString.Length - 2).ToString() streetMarkerIndex = getLastIndexOf(splitString, streetMarker) + 1 Dim sb As New StringBuilder For counter As Integer = streetMarkerIndex To splitString.Length - 3 sb.Append(splitString(counter) + " ") Next counter city = RTrim(sb.ToString()) Dim addressIndex As Integer = 0 For counter As Integer = 0 To streetMarkerIndex If IsNumeric(splitString(counter)) _ Or splitString(counter).ToString.ToLower = "po" _ Or splitString(counter).ToString().ToLower().Replace(".", "") = "po" Then....
I have an asp gridview that I am exporting to Excel. The data exports perfectly except for fields that are text fields with leading zeros. I have a field in the data grid for job number that has leading zeros. When that data is exported to Excel 000564 gets exported as only 564.Is there DataFormatString expression that I can use that will force that column to be exported to Excel as text.I have also thought about changing the SQL statement to so the job number is definitely a string by concatenating using ‘J’ + jobnumber as JobNumber but my users don’t want a ‘J’ in front of the job number.Is there a DataFormatString expression for a text string?
I have a dropdown in the mvc application. I need to fetch the selected text of the dropdown. Here is the code
[Code]....
When I fetch the drpEmployee value from the FormCollection, its returns the selectedvalue means Id not Name. How I can fetch the Selected Text from the dropdown ?
I have a project which generates snapshots of a database, converts it to XML and then stores the XML inside a separate database. Unfortunately, these snapshots are becoming huge files, and are now about 10 megabytes each. Fortunately, I only have to store them for about a month before they can be discarded again but still, a month of snapshots turn out to become real bad for it's performance...I think there is a way to improve performance a lot. No, not by storing the XML in a separate folder somewhere, because I don't have write access to any location on that server. The XML must stay within the database. But somehow, the field [Content] might be optimized somehow so things will speed up...I won't need any full-text search options on this field. I will never do any searching based on this field. So perhaps by disabling this field for search instructions or whatever?The table has no references to other tables, but the structure is fixed. I cannot rename things, or change the field types. So I wonder if optimizations is still possible.Well, is it?The structure, as generated by SQL Server:
CREATE TABLE [dbo].[Snapshots]( [Identity] [int] IDENTITY(1,1) NOT NULL, [Header] [varchar](64) NOT NULL,[code]....
Performance isn't just slow when selecting data from this table but also when selecting or inserting data in one of the other tables in this database! When I delete all records from this table, the whole system is fast. When I start adding snapshots, performance starts to decrease. After about 30 snapshots, performance becomes bad and the risk of connection timeouts increase.Maybe the problem isn't in the database itself, although it's still slow when used through the management tool. (Fast when Snapshots is empty.) I mainly use ASP.NET 3.5 and the Entity Framework to connect to this database and then read the multiple tables. Maybe some performance can be gained here, although that wouldn't explain why the database is also slow from the management tools and when used through other applications with a direct connection...
I was able to get the code below to give me the value I want from my SQL table however it has to display it in a gridview so I assume that something in the code acutally makes the result a data source rather than a string value.
I'm looking for the easiest way to bind data from a SqlDataSource to textboxes dropped in Visual Studio 2008.
For example, I have 4 textboxes currently that have Address, City, State, Zip. I also have a SqlDataSource on the page fetching the ID of the record and selecting those 4 fields based on ID.
How am I able to quickly bind each box to those particular fields selected? I would think this would be really straight forward - but seems it's not. Seems like the answer is funneled towards having to create a GridView or some type of control.
how do i display a datefield field e.g. 07/27/2010 08:00:00 as Tuesday, July 27, 2010? (i want the time part but i couldnt find any fucntions that display the date in text mode?)
I am creating a SQL procedure and need to read the data back into a gridview in that format.
I am using ssrs 2005 .My text field contains the following data As follow : Database is as:i am getting value as :Total Population (in 1000s)but in ssrs it is displaying as like this : (Total Population (in 1000sBut i want as like in Database.Please let me know what is to be done at the earliest