Código C#:
Pero me da error en el if : if (validar = "A" ) Cannot explit convert type String to Bool, Dejo una captura de pantalla en el siguiente link:Ver original
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace VigilanciaPG { public partial class frmControl : Form { public frmControl() { InitializeComponent(); } private void btnBuscar_Click(object sender, EventArgs e) { DataSet dtbRegistro = clsFunciones.dtGetDataSet("Select * from tbEmpleados where StrImss='" + txtBuscar.Text + "'"); txtAPaterno.Text = dtbRegistro.Tables[0].Rows[0]["strAPaterno"].ToString(); txtAMaterno.Text = dtbRegistro.Tables[0].Rows[0]["strAMaterno"].ToString(); txtNombre.Text = dtbRegistro.Tables[0].Rows[0]["strNombre"].ToString(); txtCURP.Text = dtbRegistro.Tables[0].Rows[0]["strCURP"].ToString(); txtIMSS.Text = dtbRegistro.Tables[0].Rows[0]["strImss"].ToString(); String validar; validar = dtbRegistro.Tables[0].Rows[0]["strStatus"].ToString(); if (validar = "A" ) { pictureBox2.Image = Image.FromFile("C:\\Documents and Settings\\BW9648\\Desktop\\VigilanciaPG\\VigilanciaPG\\VigilanciaPG\\Resources\\semaforo_verde.jpg"); } } } }
http://ompldr.org/vNXB6aA
Saludos