Lately I\'ve been working on stored procedure and encountered 1 strange problem.
First, I was able to successfully call a stored procedure from the database via:
In my case parameter's SQL type
and handling null values solved this problem. It was throwing same exception No mapping exists from object type System.RuntimeType to a known managed provider native type.
for this also
var parameter1 = new SqlParameter("parameter1", typeof(string));
var parameter2 = new SqlParameter("parameter2", typeof(string));
var parameter3 = new SqlParameter("parameter3", typeof(string));
parameter1.Value = string.IsNullOrEmpty(parameter1Value) ? (object)DBNull.Value : parameter1Value;
parameter2.Value = string.IsNullOrEmpty(parameter2Value) ? (object)DBNull.Value : parameter2Value;
parameter3.Value = string.IsNullOrEmpty(parameter3Value) ? (object)DBNull.Value : parameter3Value;
http://karim-medany.blogspot.ae/2014/02/no-mapping-exists-from-object-type.html