this will do the job . either you're not understanding the post or the question :Originally posted by Xmas79
from the downloaded file:VB Code:
Public ds As New DataSet() Public str As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '***** 1ST PART ***** 'fill data from XML File ds.ReadXml("xml1.xml") '***** END 1ST PART ***** '***** 2ND PART ***** Dim dr As DataRow = ds.Tables(0).Rows(0) 'write XML content to textbox (you can store it to string 'variable type) TextBox1.Text = dr.Item(0) '***** END 2ND PART ***** '***** 3RD PART ***** 'this will store string value to dataset again Dim dasave As DataRow = ds.Tables(0).NewRow() dasave(0) = TextBox1.Text ds.Tables(0).Rows.Add(dasave) '***** END 3RD PART ***** 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?
VB Code:
Dim dr_save As DataRow = new_ds.Tables(0).NewRow() Dim mystr = "blah blah" dr_save(0) = mystr ds.Tables(0).Rows.Add(dr_save)





Reply With Quote