473,387 Members | 3,820 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,387 software developers and data experts.

ADO.NET OLEDB Parameter is Missing ?

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
'GetCetgoriesOrProducts' expects parameter '@CategoryID', which was not
supplied.

Source Error:
Line 52: MyCmd.Parameters.Add(Par_ResultType)
Line 53:
Line 54: Dim Dr As System.Data.OleDb.OleDbDataReader =
MyCmd.ExecuteReader
Line 55:
Line 56: If Dr.HasRows Then
================================================== ==

================== code ==============================
Dim Cn As New System.Data.OleDb.OleDbConnection
Cn.ConnectionString = " Provider=SQLOLEDB;server=172.17.20.2;Initial
Catalog=Sfbulbs;uid=sa;pwd=homer27;"
'ConfigurationSettings.AppSettings("ErrorLogConnSt ring")
Cn.Open()

Dim MyCmd As New System.Data.OleDb.OleDbCommand
MyCmd.Connection = Cn
MyCmd.CommandText = "GetCetgoriesOrProducts"
MyCmd.CommandType = CommandType.StoredProcedure

Dim Par_CategoryID As New System.Data.OleDb.OleDbParameter
Par_CategoryID.ParameterName = "@CategoryID"
Par_CategoryID.DbType = DbType.Int32
Par_CategoryID.Value = Request("CategoryID")
Par_CategoryID.Direction = ParameterDirection.Input

Dim Par_ResultType As New System.Data.OleDb.OleDbParameter
Par_ResultType.DbType = DbType.String
Par_ResultType.ParameterName = "@SearchResultType"
Par_ResultType.Direction = ParameterDirection.Output
Par_ResultType.Size = 50

'Dim sampParm As New System.Data.OleDb.OleDbParameter
'sampParm.ParameterName = "RETURN_VALUE"
'sampParm.OleDbType = OleDb.OleDbType.BigInt
'sampParm.Direction = ParameterDirection.ReturnValue

'MyCmd.Parameters.Add(sampParm)
MyCmd.Parameters.Add(Par_CategoryID)
MyCmd.Parameters.Add(Par_ResultType)

Dim Dr As System.Data.OleDb.OleDbDataReader = MyCmd.ExecuteReader

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

================================================== ==
Nov 22 '05 #1
2 5265
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 '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
'GetCetgoriesOrProducts' expects parameter '@CategoryID', which was not
supplied.

Source Error:
Line 52: MyCmd.Parameters.Add(Par_ResultType)
Line 53:
Line 54: Dim Dr As System.Data.OleDb.OleDbDataReader =
MyCmd.ExecuteReader
Line 55:
Line 56: If Dr.HasRows Then
================================================== ==

================== code ==============================
Dim Cn As New System.Data.OleDb.OleDbConnection
Cn.ConnectionString = " Provider=SQLOLEDB;server=172.17.20.2;Initial
Catalog=Sfbulbs;uid=sa;pwd=homer27;"
'ConfigurationSettings.AppSettings("ErrorLogConnSt ring")
Cn.Open()

Dim MyCmd As New System.Data.OleDb.OleDbCommand
MyCmd.Connection = Cn
MyCmd.CommandText = "GetCetgoriesOrProducts"
MyCmd.CommandType = CommandType.StoredProcedure

Dim Par_CategoryID As New System.Data.OleDb.OleDbParameter
Par_CategoryID.ParameterName = "@CategoryID"
Par_CategoryID.DbType = DbType.Int32
Par_CategoryID.Value = Request("CategoryID")
Par_CategoryID.Direction = ParameterDirection.Input

Dim Par_ResultType As New System.Data.OleDb.OleDbParameter
Par_ResultType.DbType = DbType.String
Par_ResultType.ParameterName = "@SearchResultType"
Par_ResultType.Direction = ParameterDirection.Output
Par_ResultType.Size = 50

'Dim sampParm As New System.Data.OleDb.OleDbParameter
'sampParm.ParameterName = "RETURN_VALUE"
'sampParm.OleDbType = OleDb.OleDbType.BigInt
'sampParm.Direction = ParameterDirection.ReturnValue

'MyCmd.Parameters.Add(sampParm)
MyCmd.Parameters.Add(Par_CategoryID)
MyCmd.Parameters.Add(Par_ResultType)

Dim Dr As System.Data.OleDb.OleDbDataReader = MyCmd.ExecuteReader

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 '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
'GetCetgoriesOrProducts' expects parameter '@CategoryID', which was not
supplied.

Source Error:
Line 52: MyCmd.Parameters.Add(Par_ResultType)
Line 53:
Line 54: Dim Dr As System.Data.OleDb.OleDbDataReader =
MyCmd.ExecuteReader
Line 55:
Line 56: If Dr.HasRows Then
================================================== ==

================== code ==============================
Dim Cn As New System.Data.OleDb.OleDbConnection
Cn.ConnectionString = " Provider=SQLOLEDB;server=172.17.20.2;Initial
Catalog=Sfbulbs;uid=sa;pwd=homer27;"
'ConfigurationSettings.AppSettings("ErrorLogConnSt ring")
Cn.Open()

Dim MyCmd As New System.Data.OleDb.OleDbCommand
MyCmd.Connection = Cn
MyCmd.CommandText = "GetCetgoriesOrProducts"
MyCmd.CommandType = CommandType.StoredProcedure

Dim Par_CategoryID As New System.Data.OleDb.OleDbParameter
Par_CategoryID.ParameterName = "@CategoryID"
Par_CategoryID.DbType = DbType.Int32
Par_CategoryID.Value = Request("CategoryID")
Par_CategoryID.Direction = ParameterDirection.Input

Dim Par_ResultType As New System.Data.OleDb.OleDbParameter
Par_ResultType.DbType = DbType.String
Par_ResultType.ParameterName = "@SearchResultType"
Par_ResultType.Direction = ParameterDirection.Output
Par_ResultType.Size = 50

'Dim sampParm As New System.Data.OleDb.OleDbParameter
'sampParm.ParameterName = "RETURN_VALUE"
'sampParm.OleDbType = OleDb.OleDbType.BigInt
'sampParm.Direction = ParameterDirection.ReturnValue

'MyCmd.Parameters.Add(sampParm)
MyCmd.Parameters.Add(Par_CategoryID)
MyCmd.Parameters.Add(Par_ResultType)

Dim Dr As System.Data.OleDb.OleDbDataReader = MyCmd.ExecuteReader

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
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...
14
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...
4
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. ...
1
by: N S S | last post by:
I Get the following Error ================ Error =============================== Procedure 'GetCetgoriesOrProducts' expects parameter '@CategoryID', which was not supplied. Description: An...
4
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:...
0
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...
1
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...
0
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...
3
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...
8
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.