Query regarding entering check box entry into database using vb .net

uma

Member
Joined
Dec 2, 2005
Messages
5
Programming Experience
Beginner
Hi,
I am having an query regarding check box. My application contains more than 300 checkboxes. My task is to enter the checked checkbox entries in to my database in a specified location.My application platform is VB .Net and Oracle. How to insert those datas into my database.

My Application Design for Eg:

TEST D1 D2 D3 D4...................... up to D28
__________________________________________________
ESR cb1 cb2 cb3 cb4..................... up to cb28
Hb cd29 cb30 cd31 cb32 ................... up to cb

cb1,cb2...etc is nothing but the name of the check boxes.
I want to check whether the cb1,cb2,cb3 upto cb28 is been checked or not and insert into the database as..

insert into xyz (test,d1,d2......d28) values ('ESR'," ", ........" ");
insert into xyz (test,d1,d2......d28) values ('Hb'," "," ",......" ");

please friends please help me out.
Thanks in advance..
 
Please explain it more precisely ... it seems like you have missed some parts. For instance, do you want to check out all checkBox control at ones and then save them into DB or something else. Btw, to get checkBox's state you can use its CheckState property while for name you can use simply name member:
VB.NET:
[SIZE=2]MessageBox.Show([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].CheckBox1.CheckState) [COLOR=darkgreen]'will return 1 or 0[/COLOR]
MessageBox.Show([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].CheckBox1.Name.ToString()) [COLOR=darkgreen]'will return the name "CheckBox1"[/COLOR][/SIZE]

I am waiting for your feedback

Regards ;)
 
Days Test1 Test2 Test3 Test4 Test5 Date
_________________________________________________________________________________
1 checkbox1 checkbox2 checkbox3 checkbox4 checkbox5 DATE1
2 checkbox6 checkbox7 checkbox8 checkbox9 checkbox10 DATE2
.
.
.
.
28 checkbox136 checkbox137 checkbox138 checkbox139 checkbox140 29/11/05


Checkbox1 - Checkbox140 are the check boxes in my application.(Vb .net)
Days,Test1,Test2,Test3,Test4,Test5 and Date are my field name in the database(Oracle)
Date1,date2 are the dates which will be entered corresponding to days
Now i have to check for each days test1 (checkbox1),test2(checkbox2).......test5(checkbox5) is checked or not.
If it is checked then that checked checkbox value should be saved as true in my database. Similarly i have check for the Day2..Since i have more number of checkboxes i cannot use my if condition like

if checkbox1.checked=true then
a=true
else
a=false
if checkbox2.checked=true then
b=true
else
b=false

if i use this method then i have to use 140 if statements which will involve lots of execution time and there is a possibility for error too.

I have to insert each row inside the database.
my insert query should be like this;
INSERT INTO XYZ(DAYS,TEST1,TEST2,TEST3,TEST4,TEST5,DATE) VALUES (1,A,B,C,D,E,Date1)
how to push the values inside the database???????.
For the Ist time:

Day1 checkbox1,checkbox2,checkbox3,checkbox4,checkbox5,date1 --- Has to be checked and entered inside the database.

For IInd time:

The entries in the Ist row will be displayed but cannot be editable. And also
Day2 checkbox6,checkbox7,checkbox8,checkbox9,checkbox10,date2 --- Has to be checked and entered inside the database.

Hence the process continues upto Day28.
Kindly help me how to go about.
Thank You
 
Back
Top