Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 21st, 2003, 06:38 PM
Authorized User
 
Join Date: Oct 2003
Location: , , Norway.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default I'm back :) Listbox var from listbox

Hi people, (Yes you to Peter :-)
I have a listbox (named lbxMyGroup). I want to insert both values from this (value and text) into a SQL Table. But I get a NULL.refrence error when I try the code below. I guess it's not getting the values from lbxMyGroup.SelectedItem.Text and lbxMyGroup.SelectedValue correctly. Anybody got a clue for me?

*********************CODE***************
'Add Groups to GroupMembers Table.
Dim li As ListItem
 For Each li In lbxMyGroup.Items
  Response.Write("selItem.Text" & lbxMyGroup.SelectedItem.Text & "<br>")
  Response.Write("selValue" & lbxMyGroup.SelectedValue & "<br>")
  SQL.Execute("Insert into GroupMembers.....
 Next


As alway.. a big thanks for any help.

All help is Good help!
Regards
Michael
__________________
------------------------
All help is Good help!
Regards
Michael
Reply With Quote
  #2 (permalink)  
Old October 21st, 2003, 06:58 PM
Authorized User
 
Join Date: Oct 2003
Location: , , Norway.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK ok ok.. My last post was a bit stupid, I cant get a selected value from an array now can I.... So I'm now working on something like this:

*********** NEW BETTER CODE (he he)*********
Dim i As Integer
For i = 0 To lbxMyGroup.Items.Count - 1
 Response.Write("selItem.Text" & lbxMyGroup.???? & "<br>")
Next

But I still cant figure out how to get my values. (problem is where all the ? are). What do I write there to get the values?

Still working on it.. Will post again if I can clue out how it's done before some mercifull soul drops a line.

------------------------
All help is Good help!
Regards
Michael
Reply With Quote
  #3 (permalink)  
Old October 21st, 2003, 07:06 PM
Authorized User
 
Join Date: Oct 2003
Location: , , Norway.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help Michael.. *Smile*
Sorry to use up the space here, I found the answer (getting toooo dependent of the auto help in Visual Studio, forget to think sometimes... Dim Michael as string = "stupid")

Well, for all you readers that have followed my amazing progress. Here is the secret to all my troubles.

***********Working Code***********
Dim i As Integer
For i = 0 To lbxMyGroup.Items.Count - 1
 Response.Write("selItem.Text: " & lbxMyGroup.Items(i).Text & "<br>")
 Response.Write("selItem.Text: " & lbxMyGroup.Items(i).Value & "<br>")
Next

------------------------
All help is Good help!
Regards
Michael
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox belete ASP.NET 2.0 Basics 2 October 19th, 2007 04:46 AM
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 07:01 AM
Help with listbox MMJiggy62 Beginning VB 6 5 July 11th, 2006 10:56 PM
Listbox alastair Access 7 January 25th, 2006 05:53 PM
Listbox vanjamier Pro JSP 0 January 6th, 2005 09:44 PM



All times are GMT -4. The time now is 03:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.