|
|
 |
| .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.
|
 |

October 21st, 2003, 07:38 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Location: , , Norway.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

October 21st, 2003, 07:58 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Location: , , Norway.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

October 21st, 2003, 08:06 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Location: , , Norway.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |