I am Using Microsoft Visual Studio 2005 and MSSQL Server 2005.
In my Website i am using ODBC Connection using "System DSN".
In my code of get Data, it is working successfully.
But, in my code of Insert Data to Database,
I am Execution Non Query which is not taking effect in database.
My Function is as under.
public int Savedata(OdbcParameter p)
int i = 0;
con = new OdbcConnection(ConfigurationManager.ConnectionStrings["connStr"].ToString());
cmd = new OdbcCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Save_Employee";
i = cmd.ExecuteNonQuery();
catch (Exception ex)
My Connection string is :
<add name="connStr" connectionString="DSN=TestODBC;Uid=myUserName;Pwd=MyPassword;"/>
Please note that -
1. my all code is working fine with SqlConnection insted of OdbcConnection.
2. Stored Procedure "Save_Employee" is working fine with SqlConnection insted of OdbcConnection.
3. but when i convert all code to OdbcConnection, the ExecuteNonQuery is success but no any record inserted in database.
Any one can help me...?
Thanks in advance your any kind of help.