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 SinghRank #605 · 4K reputationPosted Jan 14, 2016, 10:03 AM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 14, 2016, 12:35 AM EST
anuj17 reputationPosted Jan 14, 2016, 12:49 AM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Jan 14, 2016, 1:12 AM EST
combobox.Text
Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 14, 2016, 1:22 AM EST
SqlCommand cmd = new SqlCommand("select id from customer where Name ='" +comboBox1.Text+ "'", con);
Krishna Rajput SinghRank #605 · 4K reputationPosted Jan 16, 2016, 10:48 AM EST
anuj17 reputationPosted Jan 17, 2016, 7:50 PM EST