473,660 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange strings showing up in database.

Hello to all
I have an ASP.NET application that uses VB.NET as the background
language and SQL server 2K as the back end database. I just recently
converted this application from classic asp and I have some erratic behavior
that I can't understand.

Some of the text is being saved and returned in patterns like the following.
&#8729

The constant in all of it is that the string starts with &# and ends with ;
and there is a sequence of numbers contained in the middle. What is it and
is there a better solution that a regular expression to search for the
pattern and replace it? If not does anyone know how to form the string for
the regex that will find it?

Thanks in advance,
Pat
Jan 20 '06 #1
1 955
They are html character codes and can be fixed like so...

Public Function HTMLDecode(ByVa l objText As Object) As String

Dim strTemp As New System.Text.Str ingBuilder(256)

Dim strExpTab As String

If TypeOf objText Is System.DBNull Then

strTemp.Append( " ")

Else

' Create tab expansion string if not done already

If strExpTab Is Nothing Then

strExpTab = New String(" "c, 4).Replace(" ", " ")

End If

strTemp.Append( HttpUtility.Htm lDecode(objText .ToString()))

'strTemp.Append (HttpUtility.Ht mlEncode(objTex t.ToString()))

strTemp.Replace (" ", " &nbs p;") ' Two spaces

strTemp.Replace (ControlChars.T ab, strExpTab)

strTemp.Replace (ControlChars.C r, "")

strTemp.Replace (ControlChars.L f, "<br>")

If strTemp.Length = 0 Or (strTemp.Length = 1 And strTemp(0) = " "c) Then

strTemp.Remove( 0, strTemp.Length) .Append("&nbsp; ")

End If

End If

Return strTemp.ToStrin g()

End Function 'HTMLDecode

I borrowed an idea I found elsewhere. that author used the htmlencode method
of the httputitlity.

Thanks,

Pat

"Vb2Machine s" <No****@hotmail .com> wrote in message
news:ul******** ******@TK2MSFTN GP14.phx.gbl...
Hello to all
I have an ASP.NET application that uses VB.NET as the background
language and SQL server 2K as the back end database. I just recently
converted this application from classic asp and I have some erratic
behavior that I can't understand.

Some of the text is being saved and returned in patterns like the
following. &#8729

The constant in all of it is that the string starts with &# and ends with
; and there is a sequence of numbers contained in the middle. What is it
and is there a better solution that a regular expression to search for the
pattern and replace it? If not does anyone know how to form the string for
the regex that will find it?

Thanks in advance,
Pat

Jan 20 '06 #2

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

Similar topics

14
3523
by: Sebastian Meyer | last post by:
Hi newsgroup, i am trying to replace german special characters in strings like str = re.sub('ö', 'oe', str) When i work with this, i always get the message UniCode Error: ASCII decoding error : ordinal not in range(128) Yes i have googled, i searched the faq, manual and python library and searched all known soruces of information. I played with the python
0
1670
by: Moshe | last post by:
Page with a <form> action calls ASP page. The ASP page has the following structure <%@ LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit %> <% Server.ScriptTimeOut=100 With Response .Buffer = True .Expires = 0 .Clear
8
285
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, I'm doing some bitwise operations in VB.NET, and I got some strange results. If an Int16 (Short) variable has the value &HAA (8 bits) and I do a 4-bit shift: var16 = var16 << 4 I got, correctly, the value &HAA0. But, if I try to do a 8-bit shift, I got
9
2197
by: Wescotte | last post by:
Here is a small sample program I wrote in PHP to help illustrates problem I'm having. The data base is using DB2 V5R3M0. The client is WinXP machine using the iSeries Client Access Driver ver 10.00.04.00 to connect to the database. The problem is that executing the exact same SQL select statement more than twice int a row stops produces results. The first two instances will always produce the correct results but after that it will simply...
1
924
by: smoke | last post by:
hello, on my website i'm showing all the products in the database in a list, today i added some products with a program (still in dev.). All the added products are showing up in the table, but NOT on my website. Only the product that i added some days ago are showing up on the site.. It is very frustrating, could this be a .net related problem? tx
5
3103
by: Ian | last post by:
Hi everyone, I have found some bizarre (to me...!) behaviour of the Form_Activate function. I have a form which has a button control used to close the form and a subform with a datasheet view showing a list of jobs from the database. When the main form loses focus and the user clicks the 'Close' button, I kept receiving error 2585 (This action cannot be carried out whilst processing a form or report event). This was tracked down to...
3
1766
by: Nathan Guill | last post by:
I have an interface that works with an Access back-end. I would like to store and/or load user defined query strings per each user (i.e. no user can access another's queries). The idea I had was a "table" stored with the C# front-end (not in the Access database), but don't know if this is even possible. If it is, can someone let me know how? Otherwise, how do other people handle storing and loading query strings for possible later use?
1
2742
by: Mark Morss | last post by:
Is this the place to ask a win32com.client question? I am a unix person trying to run on windows, so I have little familiarity with this module. I have this code: import win32com.client """An Access connection""" def connect(data_source, user, pwd, mdw): connAccess = win32com.client.Dispatch(r'ADODB.Connection')
2
2629
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
0
8428
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
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
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
6181
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
5650
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
4176
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...
2
1739
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.