problems with checkboxes and data storing

chihiro

New member
Joined
Sep 12, 2006
Messages
3
Programming Experience
Beginner
Can you give me the coding on how to store the checkbox i checked in the
database.For eg. If i checked apple,orange,and grape, how can i make sure
in table "order" in the database,apple,orange and grape is stored.
I am using sql server.
And the coding on how can i calculate the total of the goods checked to
produce bill if the price of the goods are already stored in the "goods" table
in the database.Another question, how can i stored continuous information from 2
interfaces to one row of table in the database?For eg. in my system i am taking
order for catering.The customer will have to key in their id and quantity of
guest invited(to be multiply with the goods price) and after they chose the
time of the function,either tea break or dinner,they move to the next
interface,(which are the checkbox things above)so i want the information in the
next interface to be stored in the same row with the id and quantity from
the prev interface.Help me..Please!!Or,if it is too complicated,can you give
me any way to simplify it a little bit.Thanks in advance.!
 
erm..

Sorry,i'm not sure what u mean by ideas i've got.but i need to know how to store the data i've checked so i can view the data in the database.That's the code that i don't have.Do i need to do the data binding?
 
hi,this is one of the ways u can do it ....

VB.NET:
If (Me.CheckBox1.Checked = True) Then 
Dim str1 As String = Me.CheckBox1.Text 
com.Connection = con 
com.CommandText = "insert into rorder values('" & str1 & "')"
com.ExecuteNonQuery() 
End If
by the way change ur table name to something else coz "order" is a keyword in sql...
 
Last edited by a moderator:
I get the feeling it wont work... The table will end up having this literal text inserted to it:


" & str1 & "
 
hi cjard the thing is in my browser our edit window is not downloading properly....(it is doing it with errors...) coz of that i wasnt able to use the quotes and all those stuff on our edit window panel...thats why i manually put some " " (that bcome &quot) on my post..
 
You might be able to change your control panel settings here so that you are using the basic editor by default. You can also try clicking the
switchmode.gif
button in the top right. Basic editor has a white background.

Most text is represented verbatim, so type it that way :)
 
Back
Top