G
Guest
I am trying to pass a filename or file location to a stored proc and am
getting an SqlException. I am using C# in .NET with SQL 2000. I
believe the error is in the line where I set the value but then again what
do I know?
Here is part of my code:
SqlCommand myCommand = new SqlCommand("sp_test", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
SqlParameter myParam = new SqlParameter("@xmlFile", SqlDbType.Text, 1000);
myParam.value = "c:\\test.xml";
myCommand.Parameters.Add(myParam);
myConnection.Open();
try {
myCommand.ExecuteNonQuery();
etc etc
It gets an error at the above execution point with the error:
SqlException: System.Data.SqlClient.SqlError: XML Parsing error: Invalid at
the top level of the document.
I think I need to give it some command where I specify the value to say find
the location of the file......
Why is is so difficult to pass a filename or location of file to a SPROC ?
Please help!
LW
getting an SqlException. I am using C# in .NET with SQL 2000. I
believe the error is in the line where I set the value but then again what
do I know?
Here is part of my code:
SqlCommand myCommand = new SqlCommand("sp_test", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
SqlParameter myParam = new SqlParameter("@xmlFile", SqlDbType.Text, 1000);
myParam.value = "c:\\test.xml";
myCommand.Parameters.Add(myParam);
myConnection.Open();
try {
myCommand.ExecuteNonQuery();
etc etc
It gets an error at the above execution point with the error:
SqlException: System.Data.SqlClient.SqlError: XML Parsing error: Invalid at
the top level of the document.
I think I need to give it some command where I specify the value to say find
the location of the file......
Why is is so difficult to pass a filename or location of file to a SPROC ?
Please help!
LW