473,320 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Checkboxlist - inserting values into tables

I have four related tables. I need to do an insert on three of them. I
created a stored procedure that handles the insert on two of the tables
correctly . . . then I get to a tough part.

The third table consists of merely SomeID2 col from the second table and
SomeID4 that comes from the fourth table.

The fourth table is used to populate a checkboxlist and contains only
SomeID4 and a description.

In order to fill the third table, I have to loop through the checked items
in the checkboxlist and get the SomeID4 values to throw into it, along with
the SomeID2 values for each row.

I can't seem to find a way to merely put the language at the end of the
stored procedure that works. I then tried an additional stored procedure for
just the third table that I executed in a loop in my VB code. It runs
without errors, but is not filling the third table!!

I tried the following:

<snip>
Dim li as ListItem
For Each li in cblSType.Items
If li.Selected then
Dim cmd2 as New Sqlclient.SqlCommand
cmd2 = cnn.CreateCommand
cmd2 = New SqlCommand("spInsertTType", cnn)
cmd2.CommandType = CommandType.StoredProcedure
cmd2.Parameters.Add("@TID", StoreTID)
cmd2.Parameters.Add("@TFTypePK", li.Value)
End If
Next
<snip>

I tried to get the SomeID2 value from Table 2 at the beginning of the code
when I was listing the parameters for filling the tables that worked:
<snip>
cmd.Parameters.Add("@TID", 4)
cmd.Parameters("@TID").Direction = ParameterDirection.Output
Dim StoreTID As Integer
StoreTID = cmd.Parameters("@TID").Value
<snip>

Any help anyone can give me will be greatly appreciated! I've been working
on this one for hours -- I'm to the point where I'm just going round 'n round.
--
Sandy
Nov 19 '05 #1
0 1565

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Agi Chen | last post by:
Hello, theres, I'm newbie in asp.net. I have problem in CheckBoxList binding to database. Considering my case in a member system, if I have 2 tables one for interest, one for memberInterest the...
1
by: Tom | last post by:
Hi, I have a webform which has DropDownList, RadioButtonList and CheckBoxList. All values are in webform, but not select from DB table as they do not need to be used as search requirements. ...
0
by: wjer | last post by:
I am trying to do two things for a test app: 1) Populate a CheckboxList webcontrol by loading a list of subject names (for the DataTextField) and subject codes (for the DataValueField). 2)...
2
by: Ratman | last post by:
I have the following function that created a checkboxlist and "is supposed" to be checking values that are already saved in the database. As I step thru the code, it is in fact marking the...
3
by: I am Sam | last post by:
I keep getting the following error message when I try to iterate through a CheckBoxList control: Object reference not set to an instance of an object. Description: An unhandled exception...
2
by: Patrick.O.Ige | last post by:
I have some boolean value(1 or 0 ) in a table and i want a databinded CheckBoxList to present the selected values on the page.. With CheckBox i know i can se the Checked property like so :-...
3
by: Stephen | last post by:
Hi, I have a question on checkboxlist, suppose I have a checkboxlist and has listitems like USA Canada UK Germany Australia Suppose I have a resultset that has values (USA, UK and Australia)
0
by: gp | last post by:
I am and have been using PDO for about a year now...and have finally gotten around to solving the "DB NULL value" issues I ran into early on... I am looking for suggestions and techniques to...
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.