Originally posted by Xmas79
from the downloaded file:
VB Code:
  1. Public ds As New DataSet()
  2.     Public str As String
  3.  
  4.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5. '***** 1ST PART *****
  6.         'fill data from XML File
  7.         ds.ReadXml("xml1.xml")
  8. '***** END 1ST PART *****
  9.  
  10. '***** 2ND PART *****
  11.         Dim dr As DataRow = ds.Tables(0).Rows(0)
  12.         'write XML content to textbox (you can store it to string
  13.         'variable type)
  14.         TextBox1.Text = dr.Item(0)
  15. '***** END 2ND PART *****
  16.  
  17. '***** 3RD PART *****
  18.         'this will store string value to dataset again
  19.         Dim dasave As DataRow = ds.Tables(0).NewRow()
  20.         dasave(0) = TextBox1.Text
  21.         ds.Tables(0).Rows.Add(dasave)
  22. '***** END 3RD PART *****
  23.  
  24.     End Sub

1ST PART: Fill a DataSet reading from file. Not what I want.
2ND PART: Takes a row from an already filled DataSet and put it into a textbox. Not what I want.
3RD PART: Put back the textbox.text into an already structured, well formed DataSet. Not what I want.

WHAT I WANT: Fill a new empty DataSet from a String. It means that I have a string that IS a dataset in XML form. I could save it to a file, and then read it with the 1ST PART method. But I don't want to save to file! Clear?
this will do the job . either you're not understanding the post or the question :

VB Code:
  1. Dim dr_save As DataRow = new_ds.Tables(0).NewRow()
  2.  Dim mystr = "blah blah"
  3. dr_save(0) = mystr
  4. ds.Tables(0).Rows.Add(dr_save)