Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Working, sorta...drop down list

Reply
Thread Tools

Working, sorta...drop down list

 
 
zamdrist@gmail.com
Guest
Posts: n/a
 
      12-14-2005
I have an ASPX codebehind webform with two drop down lists. The first
code below gets data and populates the ddl. The second (ddlGroups)
fails and I cannot figure out why. I checked the permissions of the
stored procedure, even ran it via query analyzer.

Although I haven't figured out how to turn debugging on, by process of
elimination I believe it's the line .DataSource=...in the second With,
End With that appears to be failing with a runtime error. The first
works splendidly.

Any thoughts, ideas? Thanks...

Dim adoComm_Attorney As New
SqlCommand("sp_UTL_MGProlawContacts_GetAttorneyCat egories", adoConn)

With ddlAttorney
.DataSource = adoComm_Attorney.ExecuteReader()
.DataTextField = "Category"
.DataValueField = "Category"
.DataValueField = "Category"
.DataBind()
End With


Dim adoComm_Groups As New
SqlCommand("sp_UTL_MGProlawContacts_GetGroups", adoConn)

With ddlGroups
.DataSource = adoComm_Groups.ExecuteReader()
.DataTextField = "CategoryGroup"
.DataValueField = "CategoryGroup"
.DataBind()
End With

 
Reply With Quote
 
 
 
 
adi.jog@gmail.com
Guest
Posts: n/a
 
      12-14-2005
Close the first reader before the second ExecuteReader,
since you are executing both the readers on the same connection.

In the future, remember it's easier to answer a question if you provide
the actual error message instead of a generic "appears to be failing
with a runtime error"

hope this helps

 
Reply With Quote
 
 
 
 
zamdrist@gmail.com
Guest
Posts: n/a
 
      12-14-2005
Like this?

adoComm_Attorney.ExecuteReader.Close()

Unfortunately, because debugging isn't configured correctly via ASP.Net
& the web server, all I do get is 'runtime error' and no real
explanation of what the actual error is. I wish I could give you more
info, but I've never been able to get asp.net debugging to work.

Closing the reader as I did above unfortunately only returns runtime
error...again

Thanks...
(E-Mail Removed) wrote:
> Close the first reader before the second ExecuteReader,
> since you are executing both the readers on the same connection.
>
> In the future, remember it's easier to answer a question if you provide
> the actual error message instead of a generic "appears to be failing
> with a runtime error"
>
> hope this helps


 
Reply With Quote
 
zamdrist@gmail.com
Guest
Posts: n/a
 
      12-14-2005
I figured out, I needed to define a SQLDataReader variable.

..
..
..
Dim GroupReader As SqlDataReader
GroupReader = adoComm_Groups.ExecuteReader
..
..
..
GroupReader.Close()

Thanks for pointing me in the right direction!

 
Reply With Quote
 
Mythran
Guest
Posts: n/a
 
      12-15-2005

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I figured out, I needed to define a SQLDataReader variable.
>
> .
> .
> .
> Dim GroupReader As SqlDataReader
> GroupReader = adoComm_Groups.ExecuteReader
> .
> .
> .
> GroupReader.Close()
>
> Thanks for pointing me in the right direction!
>


Yay, now that it works...let's work on another one of your
problems...getting ASP.Net Debugging to work

When you try to start with debugging, do you get an error? If so, open the
MSDN library and enter this in the address bar for it:

ms-help://MS.MSDNQTR.2003FEB.1033/vsdebug/html/vxtbsHTTPServerErrors.htm

This has several solutions to some common problems with setting up ASP.Net
debugging

If you still have trouble, let us know

Mythran

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
How do I create a Drop Down List with Hyperlinks as List Items in ASP.NET Tony Tone ASP .Net 2 04-28-2006 07:33 PM
How do I create a Drop Down List with Hyperlinks as List Items in ASP.NET Tony Tone ASP .Net 0 04-28-2006 06:38 PM
Auto Drop down a Drop Down List xxbmichae1@supergambler.com Javascript 5 11-23-2005 01:35 AM
how to include country list in my own drop down list? Wong CS ASP .Net 0 01-30-2005 09:11 AM



Advertisments