barani sanam
شنبه 20 مهر 1387, 23:28 عصر
سلام
توی کد پایین برای query اروره syntax میده من بارها چکش کردم ولی دلیلشو پیدا نکردم!
لطفا اگه سوال دیدن جواب بدین تا فردا پس فردا لازمش دارم
private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim i As Integer
i = MsgBox("آیا میخواهید تغییرات ذخیره شود؟", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "")
If i = vbNo Then
Exit Sub
End If
Dim str As String
For i = 0 To DataGridView1.RowCount - 1
str = "update tayinvaght set hashtdah='" & DataGridView1.Rows(i).Cells(3).Value & dahtadavazdah='" & DataGridView1.Rows(i).Cells(4).Value & "'," & "yektse='" & DataGridView1.Rows(i).Cells(5).Value & "'," & "setpanj='" & DataGridView1.Rows(i).Cells(6).Value & "'," & "panjthaft='" & DataGridView1.Rows(i).Cells(7).Value & "'," & "date='" & DataGridView1.Rows(i).Cells(8).Value & "' where personelcode='" & DataGridView1.Rows(i).Cells(2).Value & "' and date='" & DataGridView1.Rows(i).Cells(8).Value & "'"
()x.connect
(x.Runsql1(str
Next i
End Sub
اینم کدش البته اینجا که کپی کردم اینجوری شد.:گریه:
توی کد پایین برای query اروره syntax میده من بارها چکش کردم ولی دلیلشو پیدا نکردم!
لطفا اگه سوال دیدن جواب بدین تا فردا پس فردا لازمش دارم
private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim i As Integer
i = MsgBox("آیا میخواهید تغییرات ذخیره شود؟", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "")
If i = vbNo Then
Exit Sub
End If
Dim str As String
For i = 0 To DataGridView1.RowCount - 1
str = "update tayinvaght set hashtdah='" & DataGridView1.Rows(i).Cells(3).Value & dahtadavazdah='" & DataGridView1.Rows(i).Cells(4).Value & "'," & "yektse='" & DataGridView1.Rows(i).Cells(5).Value & "'," & "setpanj='" & DataGridView1.Rows(i).Cells(6).Value & "'," & "panjthaft='" & DataGridView1.Rows(i).Cells(7).Value & "'," & "date='" & DataGridView1.Rows(i).Cells(8).Value & "' where personelcode='" & DataGridView1.Rows(i).Cells(2).Value & "' and date='" & DataGridView1.Rows(i).Cells(8).Value & "'"
()x.connect
(x.Runsql1(str
Next i
End Sub
اینم کدش البته اینجا که کپی کردم اینجوری شد.:گریه: