Permit2kill
Member
- Joined
- Jun 25, 2007
- Messages
- 21
- Programming Experience
- Beginner
I've been playing around with VB.net/ASP.net and MySQL lately. Mostly just selecting, updating and inserting kind of stuff. I followed an online tutorial on this stuff and I'm having a bit of trouble. I can run the commands fine, but I'm left with a DataSet of information.
Essentially, what this code does is pull me a row from my database and seems to store it in a DataSet. How about do I go turning that DataSet and the information in each column into a string format?
Thanks. =)
VB.NET:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myConnection As MySqlConnection
Dim myDataAdapter As MySqlDataAdapter
Dim myDataSet As DataSet
Dim strSQL As String
myConnection = New MySqlConnection("server=localhost; user id=********; password=********; database=********; pooling=false;")
Dim strAddedName As String = Me.txtAddName.Text
strSQL = "SELECT * FROM users WHERE username = '" & strAddedName & "';"
myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
myDataSet = New DataSet()
myDataAdapter.Fill(myDataSet, "users")
MySQLDataGrid.DataSource = myDataSet
MySQLDataGrid.DataBind()
myConnection.Close()
End Sub
Essentially, what this code does is pull me a row from my database and seems to store it in a DataSet. How about do I go turning that DataSet and the information in each column into a string format?
Thanks. =)