Public Class Form_Edit
Dim objConn As New MySqlConnection
Dim objCmd As New MySqlCommand
Dim dtAdapter As MySqlDataAdapter
Dim dt As New DataTable
Dim Connection, strSQL As String
Private Sub Form_Edit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Connection As String
Dim Sho As New DataTable
Connection = ("Database=account ;Data Source=localhost;User Id=root;Password=root;Allow Zero Datetime=true")
objConn = New MySqlConnection(Connection)
objConn.Open()
Dim strSQL As String
strSQL = "SELECT * FROM income WHERE ID_income " & ID.Text & " ' "
dtAdapter = New MySqlDataAdapter(strSQL, objConn)
dtAdapter.Fill(dt) <----------------------------------------------------------------------------ตรงนี้ครับ
If dt.Rows.Count > 0 Then
Me.ID.Text = dt.Rows(0)("ID_income")
Me.CreateDate.Value = dt.Rows(0)("Date")
Me.TextBoxList.Text = dt.Rows(0)("List")
Me.TextBoxmounny.Text = dt.Rows(0)("Money")
Me.TextBoxComment.Text = dt.Rows(0)("Comment")
End If
dt = Nothing
End Sub
Tag : ASP.NET MySQL, Win (Windows App), VS 2010 (.NET 4.x), Windows