473,795 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADO.NET OLEDB Parameter is Missing ?

I Get the following Error
=============== = Error =============== =============== =
Procedure 'GetCetgoriesOr Products' expects parameter '@CategoryID', which
was not supplied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.Ole Db.OleDbExcepti on: Procedure
'GetCetgoriesOr Products' expects parameter '@CategoryID', which was not
supplied.

Source Error:
Line 52: MyCmd.Parameter s.Add(Par_Resul tType)
Line 53:
Line 54: Dim Dr As System.Data.Ole Db.OleDbDataRea der =
MyCmd.ExecuteRe ader
Line 55:
Line 56: If Dr.HasRows Then
=============== =============== =============== =======

=============== === code =============== ===============
Dim Cn As New System.Data.Ole Db.OleDbConnect ion
Cn.ConnectionSt ring = " Provider=SQLOLE DB;server=172.1 7.20.2;Initial
Catalog=Sfbulbs ;uid=sa;pwd=hom er27;"
'ConfigurationS ettings.AppSett ings("ErrorLogC onnString")
Cn.Open()

Dim MyCmd As New System.Data.Ole Db.OleDbCommand
MyCmd.Connectio n = Cn
MyCmd.CommandTe xt = "GetCetgoriesOr Products"
MyCmd.CommandTy pe = CommandType.Sto redProcedure

Dim Par_CategoryID As New System.Data.Ole Db.OleDbParamet er
Par_CategoryID. ParameterName = "@CategoryI D"
Par_CategoryID. DbType = DbType.Int32
Par_CategoryID. Value = Request("Catego ryID")
Par_CategoryID. Direction = ParameterDirect ion.Input

Dim Par_ResultType As New System.Data.Ole Db.OleDbParamet er
Par_ResultType. DbType = DbType.String
Par_ResultType. ParameterName = "@SearchResultT ype"
Par_ResultType. Direction = ParameterDirect ion.Output
Par_ResultType. Size = 50

'Dim sampParm As New System.Data.Ole Db.OleDbParamet er
'sampParm.Param eterName = "RETURN_VAL UE"
'sampParm.OleDb Type = OleDb.OleDbType .BigInt
'sampParm.Direc tion = ParameterDirect ion.ReturnValue

'MyCmd.Paramete rs.Add(sampParm )
MyCmd.Parameter s.Add(Par_Categ oryID)
MyCmd.Parameter s.Add(Par_Resul tType)

Dim Dr As System.Data.Ole Db.OleDbDataRea der = MyCmd.ExecuteRe ader

If Dr.HasRows Then
Do While Dr.Read
Response.Write( Dr(0) & "---" & Dr(1))
Loop
Dr.Close()
End If

=============== =============== =============== =======
Nov 22 '05 #1
2 5302
I found the Problem
the error was due to Null being passed to the Value of Paramter "@CetgoryID "
I would suggest other facing such problems to check for the Null Values to
the parameters
=============== =============== =============== ========

"N S S" wrote:
I Get the following Error
=============== = Error =============== =============== =
Procedure 'GetCetgoriesOr Products' expects parameter '@CategoryID', which
was not supplied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.Ole Db.OleDbExcepti on: Procedure
'GetCetgoriesOr Products' expects parameter '@CategoryID', which was not
supplied.

Source Error:
Line 52: MyCmd.Parameter s.Add(Par_Resul tType)
Line 53:
Line 54: Dim Dr As System.Data.Ole Db.OleDbDataRea der =
MyCmd.ExecuteRe ader
Line 55:
Line 56: If Dr.HasRows Then
=============== =============== =============== =======

=============== === code =============== ===============
Dim Cn As New System.Data.Ole Db.OleDbConnect ion
Cn.ConnectionSt ring = " Provider=SQLOLE DB;server=172.1 7.20.2;Initial
Catalog=Sfbulbs ;uid=sa;pwd=hom er27;"
'ConfigurationS ettings.AppSett ings("ErrorLogC onnString")
Cn.Open()

Dim MyCmd As New System.Data.Ole Db.OleDbCommand
MyCmd.Connectio n = Cn
MyCmd.CommandTe xt = "GetCetgoriesOr Products"
MyCmd.CommandTy pe = CommandType.Sto redProcedure

Dim Par_CategoryID As New System.Data.Ole Db.OleDbParamet er
Par_CategoryID. ParameterName = "@CategoryI D"
Par_CategoryID. DbType = DbType.Int32
Par_CategoryID. Value = Request("Catego ryID")
Par_CategoryID. Direction = ParameterDirect ion.Input

Dim Par_ResultType As New System.Data.Ole Db.OleDbParamet er
Par_ResultType. DbType = DbType.String
Par_ResultType. ParameterName = "@SearchResultT ype"
Par_ResultType. Direction = ParameterDirect ion.Output
Par_ResultType. Size = 50

'Dim sampParm As New System.Data.Ole Db.OleDbParamet er
'sampParm.Param eterName = "RETURN_VAL UE"
'sampParm.OleDb Type = OleDb.OleDbType .BigInt
'sampParm.Direc tion = ParameterDirect ion.ReturnValue

'MyCmd.Paramete rs.Add(sampParm )
MyCmd.Parameter s.Add(Par_Categ oryID)
MyCmd.Parameter s.Add(Par_Resul tType)

Dim Dr As System.Data.Ole Db.OleDbDataRea der = MyCmd.ExecuteRe ader

If Dr.HasRows Then
Do While Dr.Read
Response.Write( Dr(0) & "---" & Dr(1))
Loop
Dr.Close()
End If

=============== =============== =============== =======

Nov 22 '05 #2
I found the Problem
the error was due to Null being passed to the Value of Paramter "@CetgoryID "
I would suggest other facing such problems to check for the Null Values to
the parameters
=============== =============== =============== ========

"N S S" wrote:
I Get the following Error
=============== = Error =============== =============== =
Procedure 'GetCetgoriesOr Products' expects parameter '@CategoryID', which
was not supplied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.Ole Db.OleDbExcepti on: Procedure
'GetCetgoriesOr Products' expects parameter '@CategoryID', which was not
supplied.

Source Error:
Line 52: MyCmd.Parameter s.Add(Par_Resul tType)
Line 53:
Line 54: Dim Dr As System.Data.Ole Db.OleDbDataRea der =
MyCmd.ExecuteRe ader
Line 55:
Line 56: If Dr.HasRows Then
=============== =============== =============== =======

=============== === code =============== ===============
Dim Cn As New System.Data.Ole Db.OleDbConnect ion
Cn.ConnectionSt ring = " Provider=SQLOLE DB;server=172.1 7.20.2;Initial
Catalog=Sfbulbs ;uid=sa;pwd=hom er27;"
'ConfigurationS ettings.AppSett ings("ErrorLogC onnString")
Cn.Open()

Dim MyCmd As New System.Data.Ole Db.OleDbCommand
MyCmd.Connectio n = Cn
MyCmd.CommandTe xt = "GetCetgoriesOr Products"
MyCmd.CommandTy pe = CommandType.Sto redProcedure

Dim Par_CategoryID As New System.Data.Ole Db.OleDbParamet er
Par_CategoryID. ParameterName = "@CategoryI D"
Par_CategoryID. DbType = DbType.Int32
Par_CategoryID. Value = Request("Catego ryID")
Par_CategoryID. Direction = ParameterDirect ion.Input

Dim Par_ResultType As New System.Data.Ole Db.OleDbParamet er
Par_ResultType. DbType = DbType.String
Par_ResultType. ParameterName = "@SearchResultT ype"
Par_ResultType. Direction = ParameterDirect ion.Output
Par_ResultType. Size = 50

'Dim sampParm As New System.Data.Ole Db.OleDbParamet er
'sampParm.Param eterName = "RETURN_VAL UE"
'sampParm.OleDb Type = OleDb.OleDbType .BigInt
'sampParm.Direc tion = ParameterDirect ion.ReturnValue

'MyCmd.Paramete rs.Add(sampParm )
MyCmd.Parameter s.Add(Par_Categ oryID)
MyCmd.Parameter s.Add(Par_Resul tType)

Dim Dr As System.Data.Ole Db.OleDbDataRea der = MyCmd.ExecuteRe ader

If Dr.HasRows Then
Do While Dr.Read
Response.Write( Dr(0) & "---" & Dr(1))
Loop
Dr.Close()
End If

=============== =============== =============== =======

Nov 22 '05 #3

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

Similar topics

0
5810
by: Prabhakar Chola | last post by:
I got this error on production and I rebooted the server and the problem went away. It happens at random. Please help. Environment W2K with Oracle 9.2 client connected to oracle using oracle.oledb provider Specified argument was out of the range of valid values.
14
3431
by: | last post by:
Hi, I was performing SQL UPDATE queries and I notice that they SUCCEED on the ExecuteNonQuery() call with NO exceptions raised BUT they fail at the Database. They say they succeed in the code but they fail at the database. To fix this they Parameters.Add must be called in the ORDER they are in the SQL STATEMENT. This is confusing and bad.
4
362
by: John Dougherty | last post by:
I am following some code examples referring to using system.data.oledb - however, I do not have "oledb" available as an item to select. I type system.data., and I can see SQLClient, but not oledb. I assume I am missing a reference, but cannot find anything documentation to tell me which reference I could add to have oledb available in my app Any ideas - Thanks JRD
1
1780
by: N S S | last post by:
I Get the following Error ================ Error =============================== Procedure 'GetCetgoriesOrProducts' expects parameter '@CategoryID', which was not supplied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Procedure...
4
7813
by: NS | last post by:
Hi, I am trying to execute a prepare statement using oledb provider for DB2. The command.Prepare() statement is giving me an exception " No error information available: DB_E_NOCOMMAND(0x80040E0C)." My code is very simple and is working with other oledb provider, like SQL Server and oracle.
0
5292
by: silesius | last post by:
I've been using VS 2003 to develop a webapplication using C#. Today I exported the application to a remote webserver I begun experiencing problems. It's a simple application that retrieves some information from an Access database. It worked fine when I ran on my computer. I use a parameterized query to retrieve some customer specific information. Customer logs in, I store the username they log in with in the session state and on the...
1
2320
by: Brian Henry | last post by:
I have an access database, and one of the fields in the table I am inserting into has a date/time data type. What is the correct OleDb data type to insert the date and time that it is at the moment that the record was inserted at. I had this, but it gives me a "data type mismatch" error on run. Dim cmdPostQuestion As New OleDb.OleDbCommand("INSERT INTO hd_questionsasked (askedBy,questionText,dateAsked) VALUES (?,?,?)") ...
0
2783
by: silesius | last post by:
I've been using VS.NET 2003 to develop a webapplication using C#. Today I exported the application to another webserver I begun experiencing problems. It's a simple application that retrieves some information from an Access database. It worked fine when I ran on my home computer. I use a datagrid witha a dataset and a parameterized query to retrieve some customer specific information. Customer logs in, I store the username they log in...
3
8839
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I don't think I made any changes to either page other than changing the user control that creates the header). Server Error in '/myApp' Application. ---------------------------------------------------------------------------- ----
8
5401
by: erin.sebastian | last post by:
Hi all, I have a really silly problem that i can't find the answer too. I am working with VB.NET and i am trying to insert a new record into my access database (pretty easy right?) well i am getting a syntax error in my SQL statement and nothing i do will correct it. It looks FINE to me, can anyone help me out?? Thanks so much in advance, here is the code i am using Dim cn As OleDbConnection Dim cmd As OleDbCommand
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10438
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10001
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7540
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.