Click here to Skip to main content
15,891,372 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Is there any field limitaion in Structure (VB.NET) [more] Pin
Colin Angus Mackay11-Jun-08 0:43
Colin Angus Mackay11-Jun-08 0:43 
GeneralRe: Is there any field limitaion in Structure (VB.NET) [more] Pin
Michael Sync11-Jun-08 4:53
Michael Sync11-Jun-08 4:53 
GeneralRe: Is there any field limitaion in Structure (VB.NET) [more] Pin
Colin Angus Mackay11-Jun-08 13:41
Colin Angus Mackay11-Jun-08 13:41 
GeneralRe: Is there any field limitaion in Structure (VB.NET) [more] Pin
Michael Sync11-Jun-08 15:54
Michael Sync11-Jun-08 15:54 
GeneralRe: Is there any field limitaion in Structure (VB.NET) [more] Pin
Colin Angus Mackay11-Jun-08 21:12
Colin Angus Mackay11-Jun-08 21:12 
GeneralRe: Is there any field limitaion in Structure (VB.NET) [more] Pin
Michael Sync11-Jun-08 21:22
Michael Sync11-Jun-08 21:22 
QuestionReflection issue Pin
cstrader23210-Jun-08 13:09
cstrader23210-Jun-08 13:09 
QuestionGetting DataTable to clean XML to send over a socket Pin
Noctris10-Jun-08 12:18
Noctris10-Jun-08 12:18 
Hi Guys,

In a Client/Server application i was writing, i used XML in my own little protocol to send data between the client and the server in a form something like this:

CLIENTID|PROTOCOL_COMMAND_INTEGER|<xml><record><data>I will be you data for today</data></record></xml>|<eof></eof>

Now in the past i've strugled with this xml part because i need encoding that can handle é,è,ç,à and other funny characters like & and stuff..

for this, i could not use datatable.WriteXml(memorystream) (i think) because it always messed up these characters. Being the starting developer that I am , i created a little piece of horrorcode looking like this:

Public Function GetXmlFromRow(ByVal dr As DataRow, ByVal sRecordType As String) As String
        Dim sb As New IO.StringWriter
        Dim xwXmlTextWriter As New XmlTextWriter(sb)
        xwXmlTextWriter.WriteStartDocument()
        xwXmlTextWriter.WriteStartElement(sRecordType)
        Dim col As DataColumn
        For Each col In dr.Table.Columns
            xwXmlTextWriter.WriteElementString(col.ColumnName, dr.Item(col).ToString)
        Next
        xwXmlTextWriter.WriteEndDocument()
        xwXmlTextWriter.Flush()
        Return sb.ToString
    End Function


It isn't pretty.. but it does the job. Now however, i ran into trouble:

i need to send a blob in this XML (a blob which contains another XML file :s). however, i cannot do a ".ToString" from a blob cause it just returns the datatype name as a string.

How can i get a decent formatted XML file from a datatable to send over a socket OR Do i need to rethink my solution completly ? If so: What is the best way/protocol to handle these kinds of things ?

Thanks !
AnswerRe: Getting DataTable to clean XML to send over a socket Pin
Mycroft Holmes10-Jun-08 15:29
professionalMycroft Holmes10-Jun-08 15:29 
AnswerRe: Getting DataTable to clean XML to send over a socket Pin
BDEz (Member 3919223)12-Jun-08 7:27
BDEz (Member 3919223)12-Jun-08 7:27 
QuestionHow to Load an HTML Page From Resources File? Pin
Saul Johnson10-Jun-08 7:23
Saul Johnson10-Jun-08 7:23 
AnswerRe: How to Load an HTML Page From Resources File? Pin
jzonthemtn10-Jun-08 8:04
jzonthemtn10-Jun-08 8:04 
GeneralRe: How to Load an HTML Page From Resources File? Pin
Saul Johnson10-Jun-08 20:31
Saul Johnson10-Jun-08 20:31 
AnswerRe: How to Load an HTML Page From Resources File? Pin
BDEz (Member 3919223)12-Jun-08 7:49
BDEz (Member 3919223)12-Jun-08 7:49 
AnswerRe: How to Load an HTML Page From Resources File? Pin
Kenny McKee30-Jun-08 9:12
Kenny McKee30-Jun-08 9:12 
QuestionChoosing which service to use based on an appsetting Pin
daveg5510-Jun-08 3:53
daveg5510-Jun-08 3:53 
AnswerRe: Choosing which service to use based on an appsetting Pin
Christian Graus10-Jun-08 4:11
protectorChristian Graus10-Jun-08 4:11 
GeneralRe: Choosing which service to use based on an appsetting Pin
daveg5510-Jun-08 4:34
daveg5510-Jun-08 4:34 
GeneralRe: Choosing which service to use based on an appsetting Pin
Christian Graus10-Jun-08 5:06
protectorChristian Graus10-Jun-08 5:06 
AnswerRe: Choosing which service to use based on an appsetting Pin
Mycroft Holmes10-Jun-08 15:17
professionalMycroft Holmes10-Jun-08 15:17 
GeneralRe: Choosing which service to use based on an appsetting Pin
daveg5511-Jun-08 1:08
daveg5511-Jun-08 1:08 
GeneralRe: Choosing which service to use based on an appsetting Pin
Mycroft Holmes11-Jun-08 2:10
professionalMycroft Holmes11-Jun-08 2:10 
QuestionDataError Event for a Datagrid Pin
gates0910-Jun-08 1:35
gates0910-Jun-08 1:35 
AnswerRe: DataError Event for a Datagrid Pin
Mycroft Holmes10-Jun-08 15:33
professionalMycroft Holmes10-Jun-08 15:33 
QuestionHow to check file status Pin
Ebube10-Jun-08 0:34
Ebube10-Jun-08 0:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.