473,327 Members | 1,976 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,327 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 5262
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.