Good afternoon. I have a theme in C # which contains a datagridviwer, and I am populating this direct datagridiview with a database query, but it has a column that needs to be in the select, but I can not show the user in the datagridiview, how can I leave this column invisible. The column [Solical Number] must be invisible to the user.
The code that populates the datagridview follows.
private void ListaGrid()
{
string strSQL = @"select distinct
pro.Cod_Produto as CODIGO,
pro.NomeProduto as PRODUTO,
pro.Lote as LOTE,
pro.Fabricante AS REPRESENTADA,
pro.Qtda as QTDA,
sa.Id_Solicitacao AS [N° Solic.]
from tbl_SolicitacaoAmostra as sa
inner join tbl_Produto as pro with (nolock) on pro.Id_Solicitacao = sa.Id_Solicitacao
where sa.Cod_Solictacao = '" + txt_numero.Text + "'";
comando = new SqlCommand(strSQL, conex1);
try
{
SqlDataAdapter dados = new SqlDataAdapter(comando);
DataTable dtLista = new DataTable();
dados.Fill(dtLista);
DGW_itens.DataSource = dtLista;
}
catch
{
MessageBox.Show("Não existem dados a serem encontrados");
}
}