|
-
Feb 26th, 2009, 03:14 AM
#1
Thread Starter
Lively Member
[RESOLVED] Radio buttons and SQL
Hi, I have several textboxes in my form and a groubbox that have four radiobuttons. I want all the values of the textboxes (and the selection of the radiobuttons) to be stored in sql server. As far as the values of the textboxes in concerned, I managed to do it. But what about the selection of the radiobuttons??? This is the code I am using for the textboxes:
objConnection.Open()
objDataAdapter.InsertCommand = New SqlCommand()
objDataAdapter.InsertCommand.Connection = objConnection
objDataAdapter.InsertCommand.CommandText = "INSERT INTO Material " & _
"(TxtCode, TxtDescr, TxtForDescr, TxtBarcode)" & _
"VALUES (@TxtCode, @TxtDescr,@TxtForDescr, @TxtBarcode)"
objDataAdapter.InsertCommand.Parameters.AddWithValue("@TxtCode", TxtCode.Text)
objDataAdapter.InsertCommand.Parameters.AddWithValue("@TxtDescr", TxtDescr.Text)
objDataAdapter.InsertCommand.Parameters.AddWithValue("@TxtForDescr", TxtForDescr.Text)
objDataAdapter.InsertCommand.Parameters.AddWithValue("@TxtBarcode", TxtBarcode.Text)
objDataAdapter.InsertCommand.ExecuteNonQuery()
objConnection.Close()
I think that I have to write in the database numbers and not the texts of the radiobuttons. Any ideas on how can I do this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|