.net - Error Using Colon Character On XML Attributes
May 23, 2011
How do I use the class XDocument and set its attribute name to accept colon character? I get this error
"The ':' character, hexadecimal value 0x3A, cannot be included in a name."
Dim ns As XNamespace = "http://www.sitemaps.org/schemas/sitemap/0.9"
Dim xi As XNamespace = "http://www.w3.org/2001/XMLSchema-instance"
Dim sitemapValue As New XDocument(New XDeclaration("1.0", "utf-8", ""),
earlier with my program question and found out that """" is how you make " become another variable in the function:Robert = Replace(Robert.ToLower, """", "A")So now I am also trying to work with other keys like the semi-colon. I put it in the function like this:Robert = Replace(Robert.ToLower, "char(59)", "B")I also tried to insert ; in place of char(59) with in front of it as an escape key, none of this worked. It still just gives me a ; when I type
Here is a code to insert data to DBaccess from textbox. When I write a colon(') in the textbox to add to DB it caused error and show me this Message "Syntax error in string in query expression '''')'
Code: Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _ & "Data Source =" & Application.StartupPath & "Store.mdb ") Dim cmd As New OleDbCommand cmd.Connection = conn 'Add text to DB [Code] .....
c# - Why does element.getAttribute("style") ignore everything after the colon ":" character? Returning part of the value only. Basically, I have my DOM objects set up and am calling the .getAttribute method on an IMG element that is defined as below: [Code] I get the following returned: "WIDTH" only, ie: part including and after the : character is ignored. To add to this, if I do a hElement.getAttribute("width") on the IMG element, it returns the actual width as "134" even though I don't explicitely have a width="..." attribute defined. So, basically, I am asking, how can I ensure I get back things as they are written, and not as they are reconstructed and stored by IE, as that is what it seems to be doing with the inferred WIDTH attribute. Also, not sure why it is ignoring everything including and after the : character right next to the WIDTH - how can I make this work properly? Odd thing is, if I do the following, it shows everything as it should be: hElement.outerHTML.
The style attribute's value is shown as defined above. If I have to parse .outerHTML in order to get correct readings, that is just going to be depressing - I'm really disappointed in MS's half baked efforts. If you're looking for something extra to read, feel free to refer to another issue I noted about attributes returning odd behaviour when using capitals and when not (solved through a hack).
I'm using VB6, but it is all just the same, mshtml.dll, I gather, I am using IHTMLElement to define the hElement, not sure if I should be using something else but I think IHTMLElement is good for IE6+...?
The below code allows me to prevent a textbox to only allow numerics, backspace. I would also like to have the textbox to accept ":", but struggling to find the correct way to do this. Could anyone advise? Below code is in the Keypress event.
If Not Char.IsDigit(e.KeyChar) Then If Not e.KeyChar = vbBack Then ????????????? End If End If
I would like to parse a string to extract embedded parameters. [code]...
I split on the colon, then check each entry for the string "image", when found, I then extract the next entry.
I would like to use the ParseQueryString()method which works fine with equal signs and no spaces. Does anyone know if this method can work with other delimiters and spaces?
I am currently coding a tabbed web browser. I am adding a bookmarks function, but this stupid error is holding me back from compiling. I believe the code is flawless, but yet it says that a period is an invalid chracter [Code] The period in the SelectedTab.Controls is the one causing the problems, and I have no idea why.
' ', hexadecimal value 0x1F, is an invalid character
Here is my function. I get this error when it hits "reader.MoveToContent()" for the first time. Can anyone point me in the right direction?
Public Function GetSyndicationFeedData(ByVal urlFeedLocation As String) As SyndicationFeed Dim settings As New XmlReaderSettings() With { _ .IgnoreWhitespace = True, _
Public Shared Function GetData(ByVal id As Integer) As List(Of SomeClass) Dim command As New OracleCommand Dim conn As New OracleConnection(WebConfigurationManager.ConnectionStrings("ConnectionString").ToString) Dim param As New OracleParameter
[code]....
This function is giving an ORA-00911 invalid character error. I have other methods of the same style and these are functioning correctly.
Getting this error when updating a row via a gridview with a sqldatasource in Vb.net/SQL Server 2000. No matter what input (1/1/2010, blank, etc) I give it I can't seem to get it right.
Code before the input is passed to the sp:
Dim sqldatenull As DateTime Dim DateVerify As DateTime sqldatenull = DateTime.MaxValue
Im in the process of building a call loggin system and its finally been put on the server, but i keep getting the above error "Title" the first stage it goes to be authorised and when the authoriser auths it...it updates the table with the date they authorised it. which is fine, the next stage is the Business Analyst where they check all the content of the task and then approve it but for some reason unknown to me it keeps falling over on the .dateAuthorised
My Sql Column to hold the date authorised is a Datetime datatype and im converting a string to a data time within the procedure this is my Code behind page
Dim StatusNew As Integer = 53 Dim CurrentStage As Integer = 51 ITUpdateTaskTable.Add("@spWorkID", Replace(TskNumLab.Text, "LC", ""))
I have the following update code which works fine. However, it prompts an error when apostrophe (') is used in txtdesc.text. For example if you type name's , the error message will be.. Incorrect syntax near 's' Unclosed quotation mark after the character string ".
query = "UPDATE dbo.TblProjects SET ProjectDesc ='" & _ txtProdesc.Text & "' where ProjectID='" & _ txtProjectID.Text & "'" cmd = New SqlCommand(query, conn) cmd.ExecuteNonQuery()
I am facing an error in vb.net and sql server while inserting string value "Name D'Souza" into SQL. The error is "Line 1: Incorrect syntax near Souza. Unclosed quotation mark before the character string ' " In VB.net Variable is declare as string, in Stored Procedure and in SQL Table variables are declared as Varchar.
The error is: Conversion failed when converting date and/or time from character string.Basically I'm trying to make it so that when someone clicks a location in a list box it increments the correct field in a Stats table by 1 to say that they clicked the location. I've been trying to solve this for a while now and can't get anywhere. My date is in date format, and so is the Date field in my Stats table. My code can be seen below.
Dim Current As String Dim Check As String Dim objCmd2 As Object
[code]....
The issue comes in with the second SQL statement I think. I don't understand why adding a date into a date field would be an issue, I've tried adding it as a string which didn't work.
Dim i as integer For i = 0 to 365 sqlinsert.InsertCommand="insert into cashdate (date) values (getdate()+'" & i & "')"[code]....
getdate is a function in the database that returns the datetime of now i have an error that says conversion failed when converting date or time from character string .what to do now ??
How do I write an expression to calculate all characters of each row by my own defined value to each character = all the A and B and C and etc. will be as 2 and all I and J and whatever ... will be 1 so I need an end result of the total.