JohnDW
Well-known member
I have three RadioButtons in a form which the user must choose. With choice comes a value ranging from 1 to 3 in a text field, and I use that value in the insert query to a table in sql server update.
This does not work, because the value in the field of sql server is always 1.
How this coming?
Additionally I want the user require 1 of the Radio Buttons to use.
I have not found how I can achieve.
Thanks,
John
This does not work, because the value in the field of sql server is always 1.
How this coming?
Additionally I want the user require 1 of the Radio Buttons to use.
I have not found how I can achieve.
Thanks,
John
VB.NET:
Dim SQL As String = "insert into Orderscope (Klantnummer, Orderdatum, IsBetaald ) values (@Klantnummer, @Orderdatum, @IsBetaald)"
Using connection As New SqlConnection(Cnst)
Dim CMD1 As New SqlCommand(SQL, MyConnection)
CMD1.Parameters.AddWithValue("@Klantnummer", CInt(txtKlantnummer.Text))
CMD1.Parameters.AddWithValue("@Orderdatum", CDate(TxtOrderdatum.Text))
CMD1.Parameters.AddWithValue("@IsBetaald", CByte(IsBetaald.Text))
End Using
IsBetaald.Text = CStr(1)
EndSub
PrivateSub Rb2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rb2.CheckedChanged
IsBetaald.Text = CStr(2)
EndSub
PrivateSub Rb3CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rb3.CheckedChanged
IsBetaald.Text = CStr(3)
EndSub