Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 12, 2013 07:53 PM by Diddi10
Member
2 Points
32 Posts
Feb 12, 2013 06:03 PM|LINK
Hello,
Here is my code
SqlParameter System = new SqlParameter("System", SqlDbType.VarChar, 50);
System .Value = strsystem;
spcmd.Parameters.Add(System );
SqlParameter OrgID = new SqlParameter("@OrgID", SqlDbType.Int);
OrgID.Value = IntorgId;
spcmd.Parameters.Add(OrgID);
SqlParameter ReportID = new SqlParameter("@ReportID", SqlDbType.Int);
ReportID.Direction =ParameterDirection.Output;
spcmd.Parameters.Add(ReportId); // Getting error on this line
What could be the problem why i am getting this error can anyone please help me on this?
Thanks,
Participant
902 Points
132 Posts
Feb 12, 2013 07:28 PM|LINK
Just noticed in your last line you have ReportId with a small d - is this some other variable? It should be ReportID.
spcmd.Parameters.Add(ReportID); // ReportID
Feb 12, 2013 07:53 PM|LINK
Yes its a different variable.. now i changed it to ReportID its working perfectly..
Thank you so much
Diddi10
Member
2 Points
32 Posts
The SqlParameterCollection only accepts non-null SqlParameter type objects, not Int32 objects
Feb 12, 2013 06:03 PM|LINK
Hello,
Here is my code
SqlParameter System = new SqlParameter("System", SqlDbType.VarChar, 50);
System .Value = strsystem;
spcmd.Parameters.Add(System );
SqlParameter OrgID = new SqlParameter("@OrgID", SqlDbType.Int);
OrgID.Value = IntorgId;
spcmd.Parameters.Add(OrgID);
SqlParameter ReportID = new SqlParameter("@ReportID", SqlDbType.Int);
ReportID.Direction =ParameterDirection.Output;
spcmd.Parameters.Add(ReportId); // Getting error on this line
What could be the problem why i am getting this error can anyone please help me on this?
Thanks,
Talal Tayyab
Participant
902 Points
132 Posts
Re: The SqlParameterCollection only accepts non-null SqlParameter type objects, not Int32 objects
Feb 12, 2013 07:28 PM|LINK
Just noticed in your last line you have ReportId with a small d - is this some other variable? It should be ReportID.
Diddi10
Member
2 Points
32 Posts
Re: The SqlParameterCollection only accepts non-null SqlParameter type objects, not Int32 objects
Feb 12, 2013 07:53 PM|LINK
Yes its a different variable.. now i changed it to ReportID its working perfectly..
Thank you so much