Non standard characters breaks dataset

  • Thread starter Thread starter DaBrain
  • Start date Start date
D

DaBrain

Many thanks for any replies in advance...

When retrieving a Dataset if there are ANY non standard characters in
the data (ms word style quotes "for example"), they are returned
all screwed up. I must be doing something wrong here as the Dataset is
too powerful and the ?text data type too useful for this to a real
problem, what am I missing?


Again, thanks for any replies!
 
Retrieving a dataset... how? from where ?

Some examples might have helped get your problem solved.

It could be a few things maybe they've been HTMLEncoded... Try using
System.Web.HttpServerUtility.HtmlDecode(String)

It might be to do with the character set you're using on either end of this
request. I'd be doing some reading and playing around with the System.Text
namespace.

If you don't work it out make sure you post some code and examples in your
next post.

Michael
http://www.mblmsoftware.com
 
OK here is the code, again the problem is any special chars in the
dataset come back all messed up when i try to display them on the web
page, The data is fine, in fact this same code dispalys the data fine
in text box when bound in a windows Forms, but the data comes back as
follows on the web,

It's hard to see
comes out as
it’s hard to see

This is from the ' that MS word uses, as it is not a real '





string connString =
ConfigurationManager.ConnectionStrings["myconn"].ConnectionString;
using (SqlConnection LocalConnection = new
SqlConnection(connString))
{

LocalConnection.Open();

string strsql = "SELECT * FROM MyData ";

try
{
SqlDataAdapter da = new SqlDataAdapter(strsql,
LocalConnection);
DataSet ds = new DataSet();
da.Fill(ds," MyData ");

return ds;
}
catch (Exception ex)
{
return null; //for now
}
finally
{
LocalConnection.Close();
}
 
Back
Top