Click here to Skip to main content
15,914,111 members

Comments by 00210021 (Top 1 by date)

00210021 15-Oct-12 13:48pm View    
private void cmbemployee_SelectedIndexChanged(object sender, EventArgs e)
{
object varindex = cmbCustomer.SelectedValue;
//textBox1.Text = varindex.ToString();
if (true )
{
SqlConnection cnn = new SqlConnection(clsmain.cnnstr);
SqlCommand cmd = new SqlCommand();
cmd.Connection = cnn;
cmd.CommandText = "select c_id from tbl_customer where c_id = '" + varindex + "'";

try
{
if (cnn.State != ConnectionState.Open)
{
cnn.Open();
}
object respon = cmd.ExecuteScalar();
//if (respon.Read())
// {
lblfamilyCustomer1.Text = respon.ToString();
//}

}
finally
{
MessageBox.Show("ffff", "ff");
cnn.Close();
}
}