Click here to Skip to main content
15,914,943 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: arraylist Pin
Guffa7-Oct-08 0:56
Guffa7-Oct-08 0:56 
GeneralRe: arraylist Pin
eyeseetee7-Oct-08 1:05
eyeseetee7-Oct-08 1:05 
AnswerRe: arraylist Pin
sumit70347-Oct-08 1:05
sumit70347-Oct-08 1:05 
GeneralRe: arraylist Pin
eyeseetee7-Oct-08 1:27
eyeseetee7-Oct-08 1:27 
General[Message Deleted] Pin
J4amieC7-Oct-08 1:55
J4amieC7-Oct-08 1:55 
GeneralRe: arraylist Pin
eyeseetee7-Oct-08 2:03
eyeseetee7-Oct-08 2:03 
GeneralRe: arraylist Pin
J4amieC7-Oct-08 2:47
J4amieC7-Oct-08 2:47 
GeneralRe: arraylist Pin
eyeseetee7-Oct-08 2:54
eyeseetee7-Oct-08 2:54 
OK here goes
All below code is on the same page
Ive declared this at the start of the class:
ArrayList arrayitemdesc = new ArrayList();

//This code is running on the button event, basically a listbox is displayed, a user chooses some options and then clicks this button. The loop below records all the selected rows in a session.
for (int i = 0; i < listbox1.Items.Count; i++)
{
if (listbox1.Items[i].Selected == true)
{
Session["itemsdesc"] += listbox1.Items[i].Text + "
";
Session["itemscode"] += listbox1.Items[i].Value + "
";
arrayitemdesc.Add(listbox1.Items[i].Value);
}
}

//this code runs when they click the button to add the selected items into the database. For each selected item in the array the stored procedure should fire, however it isnt.
for (int i = 0; i < arrayitemdesc.Count; i++)
{
SqlCommand cmdinsertliftunion = new SqlCommand("INSERT INTO unions (union_code, item_code)
VALUES ('" + new_adb_ref + "', '" + arrayitemdesc[i].ToString() + "')", con);
cmdinsertliftunion.ExecuteNonQuery();
}

Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"



GeneralRe: arraylist Pin
eyeseetee7-Oct-08 3:18
eyeseetee7-Oct-08 3:18 
GeneralRe: arraylist Pin
J4amieC7-Oct-08 3:49
J4amieC7-Oct-08 3:49 
GeneralRe: arraylist [modified] Pin
eyeseetee7-Oct-08 4:02
eyeseetee7-Oct-08 4:02 
QuestionHow to Dynamically generate web.sitemap? Pin
wajans7-Oct-08 0:22
wajans7-Oct-08 0:22 
AnswerRe: How to Dynamically generate web.sitemap? Pin
Abhijit Jana7-Oct-08 2:58
professionalAbhijit Jana7-Oct-08 2:58 
Questionregarding paypal verification coding Pin
jegastar7-Oct-08 0:02
jegastar7-Oct-08 0:02 
AnswerRe: regarding paypal verification coding Pin
HemJoshi7-Oct-08 0:10
HemJoshi7-Oct-08 0:10 
QuestionSending SMS for Free using .Net Pin
Raheem MA6-Oct-08 23:48
Raheem MA6-Oct-08 23:48 
AnswerRe: Sending SMS for Free using .Net Pin
Eduard Keilholz7-Oct-08 0:28
Eduard Keilholz7-Oct-08 0:28 
AnswerRe: Sending SMS for Free using .Net Pin
Abhijit Jana7-Oct-08 2:59
professionalAbhijit Jana7-Oct-08 2:59 
QuestionThe page cannot be displayed Pin
BalasubramanianK6-Oct-08 23:17
BalasubramanianK6-Oct-08 23:17 
AnswerRe: The page cannot be displayed Pin
eyeseetee6-Oct-08 23:43
eyeseetee6-Oct-08 23:43 
GeneralRe: The page cannot be displayed Pin
BalasubramanianK7-Oct-08 0:02
BalasubramanianK7-Oct-08 0:02 
AnswerRe: The page cannot be displayed Pin
Sosyopat6-Oct-08 23:46
Sosyopat6-Oct-08 23:46 
GeneralRe: The page cannot be displayed Pin
BalasubramanianK7-Oct-08 0:05
BalasubramanianK7-Oct-08 0:05 
GeneralRe: The page cannot be displayed Pin
eyeseetee7-Oct-08 0:30
eyeseetee7-Oct-08 0:30 
GeneralRe: The page cannot be displayed Pin
BalasubramanianK7-Oct-08 0:54
BalasubramanianK7-Oct-08 0:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.