Hello, let's suppose I have to insert a record into a table in my database, I need the table description (e.g. fields names, type of field relations...). The question is how to get this into a new dataset. I tried the code below unsuccessfully.
VB Code:
  1. DataAdapter = DB.GetDataAdapter("SELECT * FROM mytable) ' This is a procedure in my
  2. 'class DB and it works, I posted it in another thread...
  3. Dim DS As New DataSet()
  4. DataAdapter.Fill(DS, "mytable")
  5. dim xml as string=DS.GetXmlSchema
  6. Dim ds As New DataSet()
  7.  
  8. Dim ms As New IO.MemoryStream()
  9. Dim sw As New IO.StreamWriter(ms)
  10. sw.Write(xml)
  11. sw.Flush()
  12. 'position to the start of the stream
  13. ms.Position = 0
  14. 'read the xml in to the dataset
  15. ds.ReadXmlSchema(ms) ' Here's where I get error, saying... nothing!!!(General error)
  16. 'clean up
  17. sw.Close()
  18. ms.Close()
Any ideas?

Thanks a lot!