Hi here,
The exact code is very similar. I believe it works in your PC is because of
your newsreader filtering out the problematic characters.
Dim dString as string = some select command
Dim connectionString as string = connectionstring
Dim oConnection As New System.Data.SqlClient.SqlConnection(connectionString)
Dim oSqlDataAdapter As New System.Data.SqlClient.SqlDataAdapter(dString,
oConnection)
Dim dTable As New System.Data.DataTable("dTable")
oConnection.Open()
oSqlDataAdapter.Fill(dTable)
Dim ss As New System.Text.StringBuilder
ss.Append(" " & vbCrLf)
ss.Append("-- Date : " & iDate.Trim & " -- " & vbCrLf)
For Each dd As DataRow In fTable.Rows
ss.Append(" X = : " & Convert.ToString(dd("X")).Trim & vbCrLf)
Next
dim xs as string = ss.tostring '<-The problem is that there are a series of
funny characters in the field causing the stringbuilder or string throught
it reachs the end of the string already. If my select statement does not
include those problematic rows, the string will have all the characters.
--
cheers,
RL
Chris Dunaway said:
Hi here,
I should have an example
dim cc as new stringbuilder
cc.append("abcde ede")
dim st as string = cc.tostring
st is only "abcde"
The problem is that I do not know what is " ." I only find out the "
" when I write the cc.tostring to a file.
--
cheers,
RL
The toString method does not convert the whole StringBuilder elements.
I
find out it is because there are a series of this " " inside the
stringbuilder.
This should work. What are the character codes of the characters which
are missing in the output? How do you determine that characters are
missing?
That is not the exact code that is causing your problem. I run that
code and the string contains "abcde ede" as it should. So
please show us and example that really reproduces the problem.
Chris