469,903 Members | 1,598 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

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 5130
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Prabhakar Chola | last post: by
4 posts views Thread by John Dougherty | last post: by
1 post views Thread by N S S | last post: by
1 post views Thread by Brian Henry | last post: by
8 posts views Thread by erin.sebastian | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.