Click here to Skip to main content
15,887,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
con = new OdbcConnection("DRIVER={MySQL ODBC 5.1 Driver};SERVER=192.168.0.10;DATABASE=PDF_Data;UID=heman;PASSWORD=harjeet;OPTION=3");
           con.Open();
           cmd = new OdbcCommand("insert_pdf_data", con);
           cmd.CommandType = CommandType.StoredProcedure;

           cmd.Parameters.AddWithValue("@ID", 1);
           cmd.Parameters.AddWithValue("@BatchName",DDBatch.SelectedValue.ToString());
           cmd.Parameters.AddWithValue("@ClientNm", DDClient.SelectedValue.ToString());
           
           cmd.ExecuteNonQuery();
           con.Close();
Posted
Updated 23-Aug-11 23:46pm
v2
Comments
[no name] 24-Aug-11 5:28am    
What is the error message?
phil.o 24-Aug-11 5:29am    
And what is the error/exception you get ?
LittleYellowBird 24-Aug-11 5:29am    
You need to explain what your problem is, what the error is and what you have donw to try and solve it.

1 solution

Since you didn't say WHAT was wrong, I'm going to guess that the @ID parameter should be an integer instead of a string. If you put a try/catch block around the code, you'll find out EXACTLY what is wrong.
 
Share this answer
 
Comments
anjali2 24-Aug-11 5:47am    
following error in cmd.ExecuteNonquery();
ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.0.77-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert_pdf_data' at line 1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900