January 2, 2008 at 6:03 pm
Hi,
Today got an interesting error,while using a SELECT statement on a MS SQL server. I am returning a recordset in a DataLayer, using C#.
The sql query is a simple SELECT statement in a string format as follow:
string szCommand;
string szVariable1;
string szVariable2;
string szVariable3;
string szVariable4;
szCommand = "SELECT column1, column2,";
szCommand += " column3, column4";
szCommand += " FROM Table WHERE column5 = @column5";
... (using SqlDataReader SQLReader)
and when assigning the returned records to the variables like the following:
szVariable1 = SQLReader.GetString(SQLReader.GetOrdinal("column1"));
....
some of the variables appeare in the form of the returned value from the SQLReader suffixed by the "\r" escape character, ie: one of the field in the datatable contains "michael", but is returned as "michael\r".I checked the records in the datatable which are returned back with the escape characters, but they seem to be OK, no extra character in the particular field. There is no extra code between the assigning of the returned data from ADO to the string variable. Any idea?
Thanks
Ben
Viewing post 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy