p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > .NET > Other .NET > .NET Web Services
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 21st, 2003, 07:38 PM
Authorized User
Points: 163, Level: 3
Points: 163, Level: 3 Points: 163, Level: 3 Points: 163, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 21st, 2003, 07:58 PM
Authorized User
Points: 163, Level: 3
Points: 163, Level: 3 Points: 163, Level: 3 Points: 163, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old October 21st, 2003, 08:06 PM
Authorized User
Points: 163, Level: 3
Points: 163, Level: 3 Points: 163, Level: 3 Points: 163, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox belete ASP.NET 2.0 Basics 2 October 19th, 2007 05:46 AM
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 08:01 AM
Help with listbox MMJiggy62 Beginning VB 6 5 July 11th, 2006 11: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 06:56 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc