>>public int ExecuteNonQuery(string sCommand, ArrayList colParams, CommandType Type) >>{ >> int iRetVal = 0; >> >> SqlConnection oConn = _GetConnection(true); >> >> if (oException == null) >> { >> SqlCommand oCommand = new SqlCommand(); >> oCommand.CommandText = sCommand; >> oCommand.Connection = oConn; >> >> if (colParams != null) >> { >> SqlParameter[] aParams = new SqlParameter[colParams.Count]; >> colParams.CopyTo(aParams); >> >> oCommand.Parameters.Clear(); >> oCommand.Parameters.AddRange(aParams); >> } >> >> oCommand.CommandType = Type; >> >> try >> { >> iRetVal = oCommand.ExecuteNonQuery(); >> } >> catch (SqlException e) >> { >> _oException = e; >> } >> finally >> { >> if (oConn.State == ConnectionState.Open) >> { >> oConn.Close(); >> } >> } >> >> if (_oException == null) >> { >> oCommand.Parameters.Clear(); >> } >> >> } >> >> return iRetVal; >>} >>>>