Help! What is wrong here ?



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

.



Relevant Pages

  • Re: Help! What is wrong here ?
    ... > getting an SqlException. ... I am using C# in .NET with SQL 2000. ... > Why is is so difficult to pass a filename or location of file to a SPROC? ... Are you sure that the stored procedure is expecting a filename rather ...
    (microsoft.public.dotnet.framework)
  • Get applications default file location (the "save as" location)
    ... Opens Powerpoint and creates a new presentation with that filename ... read the default file location from the Application when it opens ...
    (microsoft.public.vb.general.discussion)
  • Need help! I cannot open an excel file
    ... error message appeared: ... filename, and verify that the file location is correct. ...
    (microsoft.public.excel.misc)
  • RE: Follow Hyperlink
    ... Depending on the answer you may need to use dlookup or not. ... Dim strFile as String ... 'If you only have filename and not the complete path, ... On the double click event I would like on the selected file location ...
    (microsoft.public.access.modulesdaovba)
  • Re: What is a filename?
    ... I am not sure whether the filename of this ... "Extents" were actually the second and subsequent directory entries used to ... track the file location within the FAT ... "portion of a fully qualified pathname" but the sequence of directories (or ...
    (microsoft.public.windowsxp.general)