Good afternoon.
I have a procedure that does some commands and returns 0 = success; 1 = unsuccessful;
alter PROCEDURE [dbo].TesteRetorno
(
@DS_NOME_ARQUIVO_SINCRONISMO AS VARCHAR(200) = null
)
AS
if exists(select top 1 ID_USUARIO from BCS_USUARIO where ID_USUARIO = 'brisa')
begin
return 0
end
else
return 1
I would like to use this return in my C # code.
ParameterCollection oP = new ParameterCollection();
oP.Add("@DS_NOME_ARQUIVO_SINCRONISMO", "", DbType.String);
var retorno = DataLayer.ExecuteNonQuery("TesteRetorno", oP).ToString();
But I never get anything back;
follows the DataLayer class
#region Assembly brsBiblioteca.dll, v1.0.3.0
// C:\Users\ctorres\Documents\Projetos\FSLexMark\Legado\FRAMEWORK v3.5\LEXMARK\SAP\MigracaoSAP_V4\Packages\brsBiblioteca.dll
#endregion
using System;
using System.Data;
namespace Biblioteca.Data
{
public sealed class DataLayer
{
public DataLayer();
public static void ExecutarCommand(string pstrCommandText, ParameterCollection phtParameters);
public static void ExecutarCommand(string pstrCommandText, ParameterCollection phtParameters, string strConexao);
public static void ExecutarCommand(IDbConnection objConnection, IDbTransaction objTransaction, string pstrNomeStoredProcedure, ParameterCollection phtParameters);
public static DataSet ExecuteDataset(string pstrCommandText);
public static DataSet ExecuteDataset(string pstrCommandText, ParameterCollection phtParameters);
public static DataSet ExecuteDataset(string pstrCommandText, ParameterCollection phtParameters, string strConexao);
public static DataSet ExecuteDataset(IDbConnection conn, IDbTransaction tran, string pstrNomeStoredProcedure, ParameterCollection phtParameters);
public static DataSet ExecuteDatasetNoTransaction(string pstrCommandText);
public static DataSet ExecuteDatasetNoTransaction(string pstrCommandText, ParameterCollection phtParameters);
public static DataSet ExecuteDatasetNoTransaction(IDbConnection conn, string pstrNomeStoredProcedure, ParameterCollection phtParameters);
public static DataSet ExecuteDatasetNoTransaction(string pstrCommandText, ParameterCollection phtParameters, string strConexao);
public static int ExecuteNonQuery(string pstrCommandText);
public static int ExecuteNonQuery(string pstrCommandText, ParameterCollection phtParameters);
public static int ExecuteNonQuery(string pstrCommandText, ParameterCollection phtParameters, string strConexao);
public static int ExecuteNonQuery(IDbConnection objConnection, IDbTransaction objTransaction, string pstrNomeStoredProcedure, ParameterCollection phtParameters);
public static object ExecuteScalar(string pstrNomeStoredProcedure, ParameterCollection phtParameters);
public static object ExecuteScalar(string pstrNomeStoredProcedure, ParameterCollection phtParameters, int Timeout);
public static object ExecuteScalar(IDbConnection conn, IDbTransaction tran, string pstrNomeStoredProcedure, ParameterCollection phtParameters);
public static object ExecuteScalar(IDbConnection conn, IDbTransaction tran, string pstrNomeStoredProcedure, ParameterCollection phtParameters, int TimeOut);
public static IDbCommand GetCommand();
public static IDbConnection GetConnection();
public static IDbConnection GetConnection(string pstrConnectionString);
public static IDbDataAdapter GetDataAdapter(IDbCommand cmd);
public static DbType GetDbType(DbType pDbType);
public static System.Data.OracleClient.OracleType GetOracleType(DbType pDbType);
}
}