473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

"ExecuteCommandTextErrorHandling"

Hello Vb.net users

i am having the problem with the below code

Dim selectQuery As String = "Select Price from Items where ItemName = '"
& iname & "' AND size ='" & isize & "'"

If m_ordering.DBConnection.State <> ConnectionState.Open Then
m_ordering.DBConnection.Open()
End If

dim cmd1 As New OleDbCommand(selectQuery, m_ordering.DBConnection)
cmd1.CommandText = selectQuery
Try
cmd1.ExecuteScalar()
Catch ex As Exception
MessageBox.Show(ex.StackTrace)
end try
Thorws me the follwing exception

StackTrace
"
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextE rrorHandling(Int32
hr)
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPA
RAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteScalar()
at DBOrder.PizzaOrder.cboSize_LostFocus(Object sender, EventArgs e)
in


I got no idea what is wrong?
Can you please help me.

Thanking you all in advance

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
1 1873
"vb.net newbie" <vn@devdex.com> schrieb
Hello Vb.net users

i am having the problem with the below code

Dim selectQuery As String = "Select Price from Items where ItemName
= '" & iname & "' AND size ='" & isize & "'"

If m_ordering.DBConnection.State <> ConnectionState.Open Then
m_ordering.DBConnection.Open()
End If

dim cmd1 As New OleDbCommand(selectQuery, m_ordering.DBConnection)
cmd1.CommandText = selectQuery
Try
cmd1.ExecuteScalar()
Catch ex As Exception
MessageBox.Show(ex.StackTrace)
end try
Thorws me the follwing exception

StackTrace

What does ex.message say? Is there an Innerexcpetion? Examine the ex object
to get more information.
Armin

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Luminal | last post by:
Greetings I'm having some problems on my C# application. I'm using an access database and I'm not able to do select queries with the ' character. My code is this: // some previous code like...
1
by: AlsonToh | last post by:
No value given for one or more required parameters. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.