Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 February 27th, 2006, 11:25 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Unable to execute query.

Hi I am not able to execute following query.
----------------------------------------------
Sub insertrow(Source As Object, e As EventArgs)

        dim str as String
        dim strTsid as String
        dim intTsid as Integer

        str = "select max(tsid) from timesheet"
        DBCommand = New OleDbCommand(str, DBConnection)
        DBReader = DBCommand.ExecuteReader()
        while DBReader.Read()
            intTsid = DBReader(0) + 1
        end while
        DBReader.Close()
        strTsid = intTsid.toString()
        str = "insert into timesheet values(" & strTsid & ",13979," & ProList.SelectedItem.value & "','" & Task.SelectedItem.value & "'," & ActList.SelectedItem.value & "," & WTList.SelectedItem.value & "," & TeamList.SelectedItem.value & "," & Hours.SelectedItem.value &"," & Minutes.SelectedItem.value & ",#" & dt.text & "#,'" & comments.text & "')"

        DBCommand = New OleDbCommand(str, DBConnection)

        DBReader = DBCommand.ExecuteReader()


end sub

----------------------------------------------

It gives error beacuse not able to get values before "ProList.SelectedItem.value" i.e. ignores "strTsid" and '13979'

Please help.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old February 27th, 2006, 11:27 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

FYI : Problem is in second query and not first one.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
get the execute query result in variable mahen_pali SQL Server 2005 2 April 7th, 2008 04:04 AM
execute query without table!! al-hijjawi Classic ASP Databases 1 April 2nd, 2006 03:58 PM
Unable to execute the printing by COM through ASP rgoyal76 Classic ASP Components 0 June 27th, 2005 01:10 PM





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