if you r using SQL please check the below code string strSqlConnectionstring = "sqlserver details with provider"; System.Data.SqlClient.SqlConnection _ObjSQLCon = new System.Data.SqlClient.SqlConnection(strSqlConnectionstring.ToString()); System.Data.SqlClient.SqlCommand _ObjSqlCom = new System.Data.SqlClient.SqlCommand(); try { _ObjSQLCon.Open(); _ObjSqlCom.Connection = _ObjSQLCon; // your store procedure name _ObjSqlCom.CommandText = "Your Store procedure name"; _ObjSqlCom.CommandType = System.Data.CommandType.StoredProcedure; // you can add parameter as per your requirement // parameter name & datatype should be as per you have mentioned in your procedure // set the direction of your parameter // you need to add output parameter in the same way but direction out be output _ObjSqlCom.Parameters.Add("your parameter name", System.Data.SqlDbType.Char, 50).Direction = System.Data.ParameterDirection.Input; _ObjSqlCom.Parameters.Add("your output parameter name", System.Data.SqlDbType.Char, 50).Direction = System.Data.ParameterDirection.Output; _ObjSqlCom.Parameters[0].Value = "your parameter value"; _ObjSqlCom.ExecuteNonQuery(); // to get the output value you can use either array location of that parameter or the parameter name // if you are confused then just right click on _ObjSqlCom and view it in immediate window after you have executed _ObjSqlCom.ExecuteNonQuery(); } catch { } finally { strSqlConnectionstring = string.Empty; if (_ObjSqlCom != null) { _ObjSqlCom.Dispose(); _ObjSqlCom = null; } if (_ObjSQLCon != null) { if (_ObjSQLCon.State != System.Data.ConnectionState.Closed) { _ObjSQLCon.Close(); } _ObjSQLCon.Dispose(); _ObjSQLCon = null; } } if you further douts feel free to email me at ashwin@omtechsolutions.com :)
Ashwin Shetty. Mumbai. India