Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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 December 7th, 2006, 06:27 PM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another "No value given…" Problem

The following code will throw an error:

Dim sConx As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=X:\xxxx.mdb;"
Dim conx As OleDbConnection = New OleDbConnection(sConx)
Dim cmdUnpdInv As OleDbCommand = New OleDbCommand(sqlUnpdInv, conx)
Dim sqlUnpdInv = "SELECT SUM([Amt]) FROM " & sTblUPdI & _
                 " WHERE([Paid] = False AND [InvNum] < " & Range("InvNum").Value & ");"

Try
If conx.State = ConnectionState.Closed Then
     conx.Open()
End If

Dim dUnpdInvAmt As Double = CType(cmdUnpdInv.ExecuteScalar(), Double) 'Error
Catch ex As Exception
MsgBox(ex.Message)
'Msg: No value given for one or more required parameters
Finally
If conx.State = ConnectionState.Open Then
     conx.Close()
End If
End Try


I am really confused as everything seems to be correct in terms of syntax etc.

Any help will be greatly appreciated.

TIA,
Madcatrobert

OOPS! I discovered the problem; it would help to use the correct column name in the SQL statement.
Please disregard this entry.









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