|
|
|
รบกวน พี่ๆๆๆ ดู error ให้หน่อยค่ะ ว่า error ตรงไหนอ่ะค่ะ |
|
|
|
|
|
|
|
Code (VB.NET)
Dim cm As New SqlCommand
Dim SQL As String
cm.Connection = con
If cm.Connection.State = ConnectionState.Open Then cm.Connection.Close()
cm.Connection.Open()
If Val(RTID.Text) = 0 Then
SQL = "insert into at_order,at_order_detail (or_id,or_empid,or_date,price,total) "
SQL &= "values ('" & Trim(TextBox1.Text) & "','" & DTP1.Value.ToString("s") & "', " & Val(empid.Text) & ", '" & Replace(Trim(TextBox8.Text), ",", "") & "')"
Else
SQL = "update or_rent set or_id='" & Trim(TextBox1.Text) & "',"
SQL &= "or_date='" & DTP1.Value.ToString("s") & "',"
SQL &= "or_empid=" & Val(empid.Text) & ","
SQL &= "or_total='" & Replace(Trim(TextBox8.Text), ",", "") & "',"
'SQL &= "or_status='1'"
SQL &= " where or_id=" & Val(RTID.Text)
End If
cm.CommandText = SQL
cm.ExecuteNonQuery()
Tag : .NET, Ms SQL Server 2005, VS 2005 (.NET 2.x)
|
|
|
|
|
|
Date :
2011-04-17 21:54:39 |
By :
ice |
View :
945 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|