I have an exception problem in my program and I'm not sure how to handle it.
The error image in the DataGridView follows.
privatevoidDGW_solictacao_CellClick(objectsender,DataGridViewCellEventArgse){DataGridViewRowrow=this.DGW_solictacao.Rows[e.RowIndex];this.txt_solicitacao.Text=row.Cells[0].Value.ToString();this.txt_cliente.Text=row.Cells[1].Value.ToString();this.txt_Contato.Text=row.Cells[2].Value.ToString();this.txt_solicitante.Text=row.Cells[3].Value.ToString();this.txt_representante.Text=row.Cells[4].Value.ToString();this.txt_atuacao.Text=row.Cells[5].Value.ToString();this.txt_separador.Text=row.Cells[7].Value.ToString();this.txt_idcliente.Text=row.Cells[9].Value.ToString();stringstrSQL=@"select
SA.OBS
from tbl_SolicitacaoAmostra as SA
where SA.Cod_Solicitacao = '" + txt_solicitacao.Text + "'";
comando = new SqlCommand(strSQL, conm);
try
{
SqlDataAdapter dados = new SqlDataAdapter(comando);
DataTable dtLista = new DataTable();
dados.Fill(dtLista);
if (dtLista.Rows.Count > 0)
{
DataRow dr = dtLista.Rows[0];
txt_observacao.Text = dr[0].ToString();
}
}
catch
{
MessageBox.Show("Não existem dados a serem encontrados");
}
}