473,804 Members | 3,021 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 5305
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
3433
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
5295
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
2784
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
8843
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
9706
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
9584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
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
10082
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...
1
7622
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
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
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
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.