-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
I am using dapper dot net for making Db calls.
now one of my sp having input parameter as Db type XML
Now i am executing sp like
var param = new DynamicParameters();
param.Add("@TagXML", string.IsNullOrEmpty(student.TagXML)?null:XElement.Parse(student.TagXML));
param.Add("@CustomTagXML", string.IsNullOrEmpty(student.CustomTagXML) ? null : XElement.Parse(student.CustomTagXML));
param.Add("@Return", strRet, direction: ParameterDirection.Output);
param.Add("@RetunErrMsg", strRetMsg, direction: ParameterDirection.Output);
using (var connection = new SqlConnection(ConnectionString))
{
if (connection.State != ConnectionState.Open)
{
connection.Open();
}
connection.Execute("My Sp here", param, commandType: CommandType.StoredProcedure);
}This code giving me error:
System.NotSupportedException: The member TagXML of type System.Xml.Linq.XElement cannot be used as a parameter value
at Dapper.SqlMapper.LookupDbType(Type type, String name, Boolean demand, ITypeHandler& handler)
Why this error coming? How I can use XML type of inputs in StoredProcedure.?
Metadata
Metadata
Assignees
Labels
No labels