ExecuteDataSet Com C# e Sql Server
Amigos, boa tarde!
Estou fazendo um metodo e não achei o ExecuteDataSet. Gostaria de saber se tem esse método o SqlClient. Se não tiver coo eu faço para usar o DataSet?
Segue meu código:
public DataSet Select_By_Filter(Int32 codigoCliente, String razaoSocial)
{
DataSet ds = new DataSet();
string nomeProcedure = "Proc_SEL_BY_FILTER_Empresa";
using(SqlConnection _conn = new SqlConnection(ConfigurationManager.ConnectionStrings["CDB"].ConnectionString))
{
using(SqlCommand _cmd = new SqlCommand())
{
try
{
_cmd.Connection = _conn;
_cmd.CommandType = CommandType.StoredProcedure;
_cmd.CommandText = nomeProcedure;
SqlParameter pcodigoCliente = new SqlParameter("@codigoCliente", SqlDbType.NVarChar, 100);
pcodigoCliente.Value = codigoCliente;
_cmd.Parameters.Add(pcodigoCliente);
_conn.Open();
[b]Quero Colocar o dataSet aqui!!!![/b]
_conn.Close();
}
catch(SqlException ex)
{}
}
}
}
Agradeço a ajuda.
Discussão (3)
Carregando comentários...