S
S. H.
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(string dbConnectionString, string
sqlStatement)
{
OleDbConnection conn;
OleDbDataAdapter cmd;
DataSet results = new DataSet();
conn = new OleDbConnection(dbConnectionString);
cmd = new OleDbDataAdapter(sqlStatement, conn);
conn.Open();
cmd.Fill(results);
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.
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(string dbConnectionString, string
sqlStatement)
{
OleDbConnection conn;
OleDbDataAdapter cmd;
DataSet results = new DataSet();
conn = new OleDbConnection(dbConnectionString);
cmd = new OleDbDataAdapter(sqlStatement, conn);
conn.Open();
cmd.Fill(results);
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.