try {
if (cmbFavorecido.SelectedValue != null )
{
txtID.Text = cmbFavorecido.SelectedValue.ToString();
cn = conexao.ConectarSqlServer();
cn.Open();
SqlCommand cmd = new SqlCommand("select CNPJ_FORNECEDOR FROM FORNECEDOR WHERE ID_FORNECEDOR = " + txtID.Text, cn);
SqlDataAdapter ad = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ad.Fill(ds, "TbFornecedor");
txtCnpj.Text = ds.Tables["TbFornecedor"].Rows[0].ItemArray[0].ToString();
}