473,811 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed - unwanted regular expressions returned in query

I am using a small function to return information from an Access
database.

Whether I use xml formatted text or otherwise, the results are
returned to me in a formatted way. I'm new to C#, so I'm not certain
if I'm missing something or this is just the tough breaks with this
language. What I need is either a proper way of extracting the data
need WITHOUT the regular expressions or a work around - some way to
parse the results.

Here's the function that returns the code -- very basic stuff:

public DataSet DataQuery(strin g dbConnectionStr ing, string
sqlStatement)
{
OleDbConnection conn;
OleDbDataAdapte r cmd;
DataSet results = new DataSet();

conn = new OleDbConnection (dbConnectionSt ring);
cmd = new OleDbDataAdapte r(sqlStatement, conn);
conn.Open();
cmd.Fill(result s);
conn.Close();
}

Here is a sample of the data in the field I am returning, taken
straight from the database:

<?xml version="1.0" encoding="utf-8" ?>
<HCData HCDataID="0" Version="1.0" >

Here's what it looks like after the results dataset is filled:
<?xml version=\"1.0\" encoding=\"utf-8\" ?> \r\n<HCData HCDataID=\"0\"
Version=\"1.0\" >

Even with a regular statement - it adds the unwanted expressions:

Test = "test"
Test = \"test\"

Any help on this issue would be most appreciated!

S.H.
Nov 15 '05 #1
1 1277
Hi,

How do you actually retrieve the resultant data from the data set? And where
do you see the result being escaped? Do you inspect a data row in a Watch
window?

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"S. H." <ms*@plantdata. com> wrote in message
news:39******** *************** ***@posting.goo gle.com...
I am using a small function to return information from an Access
database.

Whether I use xml formatted text or otherwise, the results are
returned to me in a formatted way. I'm new to C#, so I'm not certain
if I'm missing something or this is just the tough breaks with this
language. What I need is either a proper way of extracting the data
need WITHOUT the regular expressions or a work around - some way to
parse the results.

Here's the function that returns the code -- very basic stuff:

public DataSet DataQuery(strin g dbConnectionStr ing, string
sqlStatement)
{
OleDbConnection conn;
OleDbDataAdapte r cmd;
DataSet results = new DataSet();

conn = new OleDbConnection (dbConnectionSt ring);
cmd = new OleDbDataAdapte r(sqlStatement, conn);
conn.Open();
cmd.Fill(result s);
conn.Close();
}

Here is a sample of the data in the field I am returning, taken
straight from the database:

<?xml version="1.0" encoding="utf-8" ?>
<HCData HCDataID="0" Version="1.0" >

Here's what it looks like after the results dataset is filled:
<?xml version=\"1.0\" encoding=\"utf-8\" ?> \r\n<HCData HCDataID=\"0\"
Version=\"1.0\" >

Even with a regular statement - it adds the unwanted expressions:

Test = "test"
Test = \"test\"

Any help on this issue would be most appreciated!

S.H.


Nov 15 '05 #2

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

Similar topics

9
3703
by: Steve | last post by:
Hello, I am writing a script that calls a URL and reads the resulting HTML into a function that strips out everthing and returns ONLY the links, this is so that I can build a link index of various pages. I have been programming in PHP for over 2 years now and have never encountered a problem like the one I am having now. To me this seems like it should be just about the simplest thing in the world, but I must admit I'm stumped BIG TIME!...
4
2217
by: pekka niiranen | last post by:
Hi there, I have perl script that uses dynamically constructed regular in this way: ------perl code starts ---- $result ""; $key = AAA\?01; $key = quotemeta $key; $line = " s^\?AAA\?01^BBB^g; #Comment "
1
4187
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make regular expressions easier to create and use (and in my experience as a regular expression user, it makes them MUCH easier to create and use.) I'm still working on formal documentation, and in any case, such documentation isn't necessarily the...
7
11447
by: mark | last post by:
Access 2000: I creating a report that has a record source built by the user who selects the WHERE values. An example is: SELECT * FROM CHARGELOG WHERE STDATE Between #10/27/2003# And #11/2/2003# And VehicleID='00000000' And BattID='LKO500HF'. I need to use the records returned to populate text boxes, but the data requires further manipulation. I attempting to use expressions in the control source
1
1823
by: Robert | last post by:
Vb.Net Make dll that contain one function. Help Please. I would like to call a function from different applications. I think i have to make a dll. I have Visual Basic.net 2003 Standard Edition, that teorically does not make dll, but pratically does. I search vbc.exe and copy it to a new folder, in which i have the
1
3727
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am attach this script files and inq files. I cant understand this error. Please suggest me. You can talk with my yahoo id b_sahoo1@yahoo.com. Now i am online. Plz....Plz..Plz...
0
2460
by: Chuck36963 | last post by:
Hi all, I've been working on a listing problem and I can't figure out how to work it out. I have looked far and wide on the web to find answers, but I'd like other peoples input on my project in the whole. I really need MySQL wizz to give me a hand (and maybe refer me to books to get me to the wizz level myself). First off, english is a second language to me and sometimes my sentences might be a little awkward. Please forgive me. Mon...
3
252
by: JoeW | last post by:
Sorry if I am asking something has already been asked but I am somewhat stuck on a problem with regular expressions. My task is simple: take an HTTP url and remove all the characters after the .com| org|edu TLD identifier and return the string. So far all my attempts have been unsuccessful. Basically all I want to do is take the URL passed in and strip out the unwanted parts return the new string so i can add it to a database for link...
1
4390
by: Allan Ebdrup | last post by:
I have a dynamic list of regular expressions, the expressions don't change very often but they can change. And I have a single string that I want to match the regular expressions against and find the first regular expression that matches the string. I've gor the regular expressions ordered so that the highest priority is first (if two or more regular expressions match the string I want the first one returned) The code that does this has...
0
9734
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
9607
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
10663
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10401
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...
0
10138
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9217
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...
0
6897
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
5567
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...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.