I'm doing a select, this same select tested in the database returns me the information I need, but in my .net code an error is saying that it is not generating a result, what will I be doing wrong
var NomeFuncionario = conexao.executeSelect("TB_FUNCIONARIO","NOME","ID_FUNCIONARIO="+teste1);
if (NomeFuncionario.Read())
lblNome.Text = NomeFuncionario.GetSqlChars(0).ToString();
function code:
public SqlDataReader executeSelect(String sTabela, String sCampos, String sWhereClause)
{
try {
string query = " SET DATEFORMAT dmy SELECT " + sCampos + " FROM " + sTabela;
if (!(sWhereClause.Equals("")))
query = query + " WHERE " + sWhereClause;
sqlcmd = new SqlCommand(query, getConnection());
return sqlcmd.ExecuteReader();
}
catch (ApplicationException e)
{
throw new ApplicationException("App_Code/conexao/executeSelect", e);
}
}