Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2004, 09:28 AM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Command text was not set for the command object.

Hi
I am getting "Command text was not set for the command object" error. below i me code amd error line is marked.

rownew = dset1.Tables("BHDATASOURCE").NewRow

                Dim get1 As New OleDbCommand(query1, myconnection)
                myreader = get1.ExecuteReader()

                While (myreader.Read())

                        rownew("RecordID") = myreader(0)
                        rownew("FundAgencyID") = myreader(1)
                        rownew("EngineeringID") = myreader(2)
                        rownew("GeotechCoID") = myreader(3)
                        rownew("DrillingCoID") = myreader(4)
                        rownew("ProjectNameID") = myreader(5)
                        rownew("HoleID") = myreader(6)
                        rownew("ReportNo") = myreader(7)
                        rownew("ContractNo") = myreader(8)
                        rownew("GeofileNo") = myreader(9)
                        rownew("DrillFileNo") = myreader(10)
                    rownew("BridgeNo") = myreader(11)

                    If Not rownew("FundAgencyID") Is DBNull.Value Then
                        strfa = "Select o.Name from ORGANISATIONNAME o, BOREHOLEDATASOURCE bds where o.OrgID=bds.FundAgencyID and o.OrgCatID=2 or bds.FundAgencyID=" & myreader(1)
                    Else
                        strfa = "Select FundAgencyID from BOREHOLEDATASOURCE"
                    End If

                    If Not rownew("EngineeringID") Is DBNull.Value Then
                        strec = "Select o.Name from ORGANISATIONNAME o, BOREHOLEDATASOURCE bds where o.OrgID = bds.EngineeringID and o.OrgCatID=3 and bds.EngineeringID=" & myreader(2)
                    Else
                        strec = "Select EngineeringID from BOREHOLEDATASOURCE"
                    End If
                    If Not rownew("GeotechCoID") Is DBNull.Value Then
                        strgc = "Select o.Name from ORGANISATIONNAME AS o, BOREHOLEDATASOURCE AS bds where o.OrgID = bds.GeotechCoID and o.OrgCatID=4 and bds.GeotechCoID=" & myreader(3)
                    Else
                        strgc = "Select GeotechCoID from BOREHOLEDATASOURCE"
                    End If
                    If Not rownew("DrillingCoID") Is DBNull.Value Then
                        strdc = "Select o.Name from ORGANISATIONNAME o, BOREHOLEDATASOURCE bds where o.OrgID = bds.DrillingCoID and o.OrgCatID=5 and bds.DrillingCoID=" & myreader(4)
                    Else
                        strdc = "Select DrillingCoID from BOREHOLEDATASOURCE"
                    End If
                    If Not rownew("ProjectNameID") Is DBNull.Value Then
                        strpn = "Select pu.ProjectName from PROJECTNAMELOOKUP pu, BOREHOLEDATASOURCE bds where pu.ProjectNameID = bds.ProjectNameID and bds.ProjectNameID=" & myreader(5)
                    Else
                        strpn = "Select ProjectNameID from BOREHOLEDATASOURCE"
                    End If
                End While
                myreader.Close()


                Dim comfa As New OleDbCommand(strfa, myconnection)
       Error line #### myreader1 = comfa.ExecuteReader()########
                While (myreader1.Read())
                    fname = myreader1(0) & ""
                End While
                myreader1.Close()


Please help

Thanks
nidy
 
Old May 19th, 2004, 12:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

I see no open connection here! did u open connection to run or not?!

Always:),
Hovik Melkomian.
 
Old May 19th, 2004, 01:36 AM
Authorized User
 
Join Date: Jun 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you sure you provided a SQL query for the variable query1? Because that is what the compiler is complaining about

Regards,

Gerhard Wentink





Similar Threads
Thread Thread Starter Forum Replies Last Post
Command text was not set for the command object Sheraz Khan Classic ASP Databases 2 May 29th, 2007 12:57 AM
Issues with Command Object and Parameters BSkelding Crystal Reports 0 May 2nd, 2007 10:29 AM
Command text was not set for the command object. deepa12 BOOK: Beginning ASP 3.0 5 November 2nd, 2004 05:37 PM
Help! 'Command object error' sisi Classic ASP Databases 4 May 25th, 2004 06:23 PM
command object scrolling qwprince Classic ASP Databases 3 July 24th, 2003 09:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.