Believe2014 Believe2014 -4 years ago 126
C# Question

Cannot pass GUID parameter to stored procedure

I can't figure out why I am getting this error.

Could anyone please help?


Even adding the

character, the code still does not run.
enter image description here

Answer Source

Please try the following:

  1. Include @ in your parameter name
  2. Set cmd.CommandType = CommandType.StoredProcedure
  3. Set p.DbType = DbType.Guid
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download