Click here to Skip to main content
15,742,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a client server application in which I need to send the dataset set object from server to the client through socket.
I want to pass that dataset object as string to the client & then on the client side convert the string back into dataset object so that I can use it with datagrid.

Any help or suggestion would definitely be welcomed
Posted

I answered this three days ago, to you: converting a dataset object into string & passing it through socket[^]

What is your problem with it, since your question is no different to last time?
 
Share this answer
 
Comments
Sandeep Mewara 20-Apr-11 7:01am    
What to say... OP is asking for links! I guess he need the exact code. :)
I want to pass that dataset object as string to the client & then on the client side convert the string back into dataset object
If you have noticed, dataset follows a defined XML format. One can easily convert the same into XML (which can easily be passed as a string) and then re-convert back that XML into dataset. Try out.
 
Share this answer
 
Comments
Pritam N. Bohra 20-Apr-11 6:56am    
please give appropriate me the link from where I can learn it
Pritam N. Bohra 20-Apr-11 6:57am    
Thanks for ur quick reply
Serialization is your friend here, have a look at the DataSet WriteXML and ReadXML methods

That will let you convert your dataset into a string

From an article on eggheadcafe[^]...

Now developers who've worked with Binary Serialization know that the ADO.NET DataSet describes itself to the Serialization Framework only in XML. You run a DataSet through the BinaryFormatter and what you get is a very large byte array filled with -- you guessed it -- a whole glop full of textual XML!

So, make sure you set your dataset formatting to Binary

http://weblogs.asp.net/skoganti/archive/2004/08/30/222525.aspx[^]

You should then be able to send your dataset over sockets are deserialize at the other end

Have a google for 'DataSet binaryformatter' for more information on this subject
 
Share this answer
 
Comments
Pritam N. Bohra 21-Apr-11 11:16am    
Thanks it worked to some extent.
I am facing some problem using dataset.ReadXML method.
It says '.' hexadecimal 0x00 not allowed. Line 218 & position 5.
I don't know what it is all about.
It replaced all '.' with white-spaces but to no avail.

Please suggest me something

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900