0
I’m getting an error after I put a chekbox column in the datagridview on my screen, and this screen is loaded by a query, put this chekbox column not in the query but directly in the datagridview.
follows the code
private void ListaGrid()
{
try
{
SqlCommand separacao = new SqlCommand("usp_SeparacaoPic", conexaoDADOADV(true));
separacao.CommandType = CommandType.StoredProcedure;
separacao.ExecuteNonQuery();
SqlDataAdapter dados = new SqlDataAdapter(separacao);
DataTable dtLista = new DataTable();
dados.Fill(dtLista);
dgw_separacaopic.DataSource = dtLista;
}
catch
{
MessageBox.Show("Não exstem dados digitados para a consulta, por favor verificar!!!");
return;
}
}
Thanks in advance.
It does not have the value in the list you are sending, so the problem or the type you are sending is not
boolean
(true or false), which is being sent?– novic
Virgilio thanks for answering, but in the column I am not passing any value, I only created the column in datagridview, and I did not configure anything in it.
– Junior Guerreiro
when you do
dgw_separacaopic.DataSource = dtLista;
that column needs a value– novic
Virgilio you can explain to me how I value the column ??
– Junior Guerreiro
bring a default value to your Storedprocedure
usp_SeparacaoPic
– novic
Virgilio understood, I will do here thank you very much.
– Junior Guerreiro
Worked out here thanks.
– Junior Guerreiro