i do have a problem, which occours on some machines but not on every machine:
when using the process.start method, it throws the exception the path is invalid.
System.Diagnostics.Process process = Process.Start(startInfo);
the startinfo is
System.Diagnostics.ProcessStartInfo startInfo = new ProcessStartInfo();
then I add Arguments (startInfo.Arguments), a FileName (startInfo.Filename), set the UseShellExecute to true (startInfo.UseShellExecute = true) ,set the CreateNoWindow to true (startInfo.CreateNoWindow) to hide the window, then set the RedirectStandardOutput to false during one try and to true in another try (startInfo.RedirectStandardOutput = false or true) and then I reset the UseShellExecute to false (startInfo.UseShellExecute = false).
Finally I invoke the methode but it throws the exception described above.
Does anyone of you have an idea? i checked all the paths and they are correct (meaning those I used during assigning the parameters).
I checked the acrobat path, it is correct. I checked the pdfFileName path, it is correct. I also checked the printername and this is correct as well.
But when starting the process it throws the error message.
What the code does: it prints a pdf file (located on harddisk) using the specified printer.
As I said in my first posting, I tried it on different systems, there are some it works fine (no error message) but there are some which cause this message. And I have no clue why.
the logging works well, so this should not be the problem!
// Add LastName to the above defined paramter @Find
"@Find", // The name of the parameter to map
System.Data.SqlDbType.NVarChar, // SqlDbType values
20, // The width of the parameter
"LastName")); // The name of the source column
// Fill the parameter with the value retrieved
// from the text field
cmd.Parameters["@Find"].Value = txtFind.Text;
// Execute the query
rdr = cmd.ExecuteReader();
// Fill the list box with the values retrieved
lblFound.Items.Add(rdr["FirstName"].ToString() + " " + rdr["LastName"].ToString());
catch (Exception ex)
// Print error message
// Close data reader object and database connection
if (rdr != null)
if (con.State == ConnectionState.Open)
Now things are Better, because Previously you just opened the Connection where you were not supposed to, remember that you have to connect to the Database when you want to execute something. after you are done you close it, and now this function returns a reader, then you can iterate through your records or your can just choose to send the data into the datatable and bind the control.
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding