how to get data from database ....
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
con.Open();
SqlCommand cmd = new SqlCommand("select id from customer where Name ='" +comboBox1.SelectedValue + "'", con);
int anuj1 = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
if (anuj1 > 0)
{
txtid.Text = Convert.ToString(anuj1);
}
}
catch
{
}
Krishna Rajput SinghPosted Jan 14, 2016, 3:03 PM
anujPosted Jan 18, 2016, 12:50 AM
Krishna Rajput SinghPosted Jan 16, 2016, 3:48 PM
Rajeesh MenothPosted Jan 14, 2016, 6:22 AM
SqlCommand cmd = new SqlCommand("select id from customer where Name ='" +comboBox1.Text+ "'", con);
Ranjit PowarPosted Jan 14, 2016, 6:12 AM
combobox.Text
anujPosted Jan 14, 2016, 5:49 AM
Ranjit PowarPosted Jan 14, 2016, 5:35 AM