Click here to Skip to main content
15,891,667 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Set adoParamInput = Server.CreateObject("ADODB.Parameter")
  adoParamInput.Type = adChar 'Char
  adoParamInput.Direction = 1 'Input Parameter
  adoParamInput.Name = "@sstrUserID"
  adoParamInput.Size = 8
  adoParamInput.Value = Session("UID")



in above code I am getting the error i.e.
@sstrUserID not supplied.

i have confirmed that the
Session("UID")
has value in it.

Please help me.
Thanks in advance
Posted
Updated 29-Jul-14 21:48pm
v2
Comments
CHill60 30-Jul-14 4:02am    
Can you show us the code where you set up the ADODB.Command and append this parameter
Ranjeet Patel 4-Aug-14 2:35am    
Hi Thanks for your comment. I got the solution. I will past the solution. Problem was with my database column size.

When executing ADO data in .Net you can't assign a .Net null value to a parameter. This equates to not providing a value for the parameter.

I'd expect that Session("UID") is null?

If you want to provide null as a parameter value you must use DBNull.Value

Replace this line:

C#
adoParamInput.Value = Session("UID")


With:

C#
adoParamInput.Value = Session("UID") ?? DBNull.Value
 
Share this answer
 
Comments
Ranjeet Patel 4-Aug-14 2:36am    
Thanks for your solution. As I mentioned that I have checked that the session value is not null. in my question.. Now I got the solution. but Thanks a lot for your attention.
HI Guys,

I got the solution. The problem was with the table column char size. It could only take 8 char length. and I was passing 16 char. That was giving the error. Now I have taken care of it and it is resolved now.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900