Help! What is wrong here ?
- From: "LW" <LW@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 17 Apr 2005 22:31:14 -0700
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
.
- Follow-Ups:
- Re: Help! What is wrong here ?
- From: Jon Skeet [C# MVP]
- Re: Help! What is wrong here ?
- Prev by Date: Re: How to tell if running in console or winexe mode?
- Next by Date: Re: Help! What is wrong here ?
- Previous by thread: plugging into the explorer shell
- Next by thread: Re: Help! What is wrong here ?
- Index(es):
Relevant Pages
|
|