In c# applicaction, the following code
SqlXmlCommand cmd = new SqlXmlCommand("Provider=SQLOLEDB;" + connectionString);
cmd.CommandType = SqlXmlCommandType.Sql;
string commandText = "exec " + procName + " ";
foreach (SqlParameter param in commandParameters)
{
if (adComma) commandText += ", ";
string paramValue = Convert.ToString(param.Value);
if ((param.SqlDbType == SqlDbType.NVarChar || param.SqlDbType == SqlDbType.NText)
&& paramValue.IndexOf("'") != -1)
paramValue = paramValue.Replace("'", "''");
if (param.SqlDbType == SqlDbType.NVarChar ||
param.SqlDbType == SqlDbType.NText)
{
commandText += "N'" + paramValue + "'";
}
else if (param.SqlDbType == SqlDbType.UniqueIdentifier ||
param.SqlDbType == SqlDbType.SmallDateTime ||
param.SqlDbType == SqlDbType.DateTime)
commandText += "'" + paramValue + "'";
else
commandText += paramValue;
adComma = true;
}
Stream o = null;
cmd.CommandText = commandText;
When it runs this command, it fails with The data area passed to a system call is too small. (Exception from HRESULT: 0x8007007A)
o = cmd.ExecuteStream();
The db engine is sql server 2014 sp3. I ran the contents of commandText on ssms and got legitimate result. What does this error mean and how to fix it?
Thanks in advance