 |
|

Code (VB.NET)
Dim sqlSave As String = ""
Dim en As New CultureInfo("en-US")
If (txttime_id.Text = "") Or (cbothea_theater.Text = "") Or (cbomov_name.Text = "") Or (txttime_time.Text = "") Or (txttime_date.Text = "") Then
MessageBox.Show("กรุณาป้อนข้อมูลให้ครบ", "ผลการตรวจสอบ", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Exit Sub
End If
Connection()
If Action = "ADD" Then
sqlSave = "Insert Into Time(time_id,thea_id,mov_id,time_time,time_date) "
sqlSave &= "Values('" & txttime_id.Text & "','" & cbothea_theater.Text & "','" & cbomov_name.Text & "','" & txttime_time.Text & "','" & (txttime_date.Value).ToString("yyyy-MM-dd", en) & "')"
ElseIf Action = "EDIT" Then
sqlSave &= "UPDATE Time "
sqlSave &= "SET thea_id = '" & cbothea_theater.Text & "',"
sqlSave &= "mov_id = '" & cbomov_name.Text & "',"
sqlSave &= "time_time = '" & txttime_time.Text & "',"
sqlSave &= "time_date = '" & txttime_date.Text & "'"
sqlSave &= "Where time_id = '" & txttime_id.Text & "'"
End If
Tag : Ms SQL Server 2005, VB.NET
|
|
 |
 |
 |
 |
Date :
2012-02-26 21:58:36 |
By :
tingtongKP |
View :
1111 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |