You don't have a connection when you call
Dim myCommand As SqlCommand = new SqlCommand("proc_selDesc", myConnection)
Because you don't open it until two lines later
myConnection.Open()
Open the connection first and you'll be fine
On Mon, 20 Dec 2004 04:42:24 -0000, ltrane923 <[EMAIL PROTECTED]> wrote:
>
>
> Thanks for responding. I have posted all my code here.
>
> http://www.loritompkins.com/sqlnop/code.html
>
> There is something wrong with the way I am making this second
> connection. Maybe it needs to be converted to a string? I can't seem
> to figure it out.
>
> The only thing I changed where the lines in red.
> They were formerly select statements
>
> FROM THIS (second statement)
> Dim myCommand As SqlCommand = new SqlCommand("Select * From
> dbo.tbltopicDesc Where topicID='" & myDropDownList.SelectedItem.Value
> & "'",myConnection)
>
> To this
> Dim myCommand As SqlCommand = new SqlCommand("proc_clname",
> myConnection)
>
> Here it is working with all select statements
> http://www.loritompkins.com/sqlnop/pulldowngrid2.aspx
>
> Here it fails [no data paints to the grid from reader]
> http://www.loritompkins.com/sqlnop/pulldowngrid6.aspx
>
> --- In [email protected], Dean Fiala <[EMAIL PROTECTED]>
> wrote:
> > According to the code in your link, the DataReader is closed after
> the
> > reader is executed...
> >
> > myDataReader = myCommand.ExecuteReader(CommandBe
> havior.CloseConnection)
> >
> > Are you sure you are calling myConnection.Open() again
> > before calling this code...
> >
> > Dim myCommand As SqlCommand = new
> > SqlCommand("secondstoredprocedure", myConnection) [this fails]
> >
> > HTH
> > --
> > Dean Fiala
> > Very Practical Software, Inc
> > http://www.vpsw.com
>
>
> Yahoo! Groups Links
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/