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
Hi! I have this application what I build and I want to put automatic updates for the application so the user will have the latest version of the application. I found in the properties menu, the publish tab, where it says about automatic updates and publish the application. So now I want to add a button to the application, so when the user will click the button it will check for the latest version and if there is a version newer then the one they are using in the moment, the app will be updated to the latest version. Any help with this how I can solve? Thanks ahead