guitardave78
Programmer
Ok, gonna rephrase a question i asked.
I am using mysql with the .net connecter in vb 2005 express.
I would like to make dll that I can use as objectdatasource in asp.net.
I can get the basic Idea (code below) but it does not quite work. If you run the asp page it displays the correct columns and data, but the editor does no display any columns, so i cannot edit the gridview!!
I know it can be done this way!!
The code in the dll is basically this
}...the bane of my life!
I am using mysql with the .net connecter in vb 2005 express.
I would like to make dll that I can use as objectdatasource in asp.net.
I can get the basic Idea (code below) but it does not quite work. If you run the asp page it displays the correct columns and data, but the editor does no display any columns, so i cannot edit the gridview!!
I know it can be done this way!!
The code in the dll is basically this
Code:
Private Sub dbConn()
If Not conn Is Nothing Then conn.Close()
Dim connStr As String
connStr = "Server=localhost;Database=dls;Uid=blag;Pwd=blahblah;"
conn = New MySqlConnection(connStr)
End Sub
Public Function selectAllMessages() As DataTable
dbConn()
Dim da As MySqlDataAdapter
Dim Data = New DataTable("messages")
da = New MySqlDataAdapter("SELECT * FROM tbl_messages", conn)
conn.Open()
da.Fill(Data)
Return Data
End Function
}...the bane of my life!