 |
|
ช่วยแนะนำวิธีการเขียน การ insert update delete vb.net ฐานข้อมูล SQL หน่อยครับ มือใหม่ |
|
 |
|
|
 |
 |
|
Code (VB.NET)
Public Sub savename(ByRef sqlstatement As String)
Dim cmd As MySqlCommand = New MySqlCommand
With cmd
.CommandText = sqlstatement
.CommandType = CommandType.Text
.Connection = SQLConnection
.ExecuteNonQuery()
End With
MessageBox.Show("เพิ่มข้อมูลเรียบร้อยแล้วค่ะ", "as", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sqlstatement As String = "insert into tb_user(user_name,password,fname,lname)values('" & TextBox1.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')"
savename(sqlstatement)
Me.Hide()
End Sub
ต้องการประมาณนี้ป่าว
|
 |
 |
 |
 |
Date :
2013-09-24 10:03:00 |
By :
smile |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ศึกษาจากตัวนี้ครับ

.NET Windows Form Application เขียนโปรแกรมบน
|
 |
 |
 |
 |
Date :
2013-09-24 10:45:18 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
 
|
 |
 |
 |
 |
Date :
2013-09-24 11:30:56 |
By :
kwanckp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|