after enter save button i need the data in the comboboxlist
after executing application if i insert some data on textbox when i click save button it will store in database but it doesn't show it in the combobox list. it show when after close the application again if i will execute then i can view in the comboboxlist. how to view spantaneously after enter save button i need the data in the comboboxlist without close the application.

Pankaj Kumar ChoudharyPosted Mar 26, 2015, 3:53 AM
public void call()
{
con.Open();
string str = "select * from pankaj";
SqlDataAdapter da = new SqlDataAdapter(str, con);
DataTable tab = new DataTable();
da.Fill(tab);
comboBox1.DataSource = tab;
comboBox1.ValueMember = "take";
comboBox1.DisplayMember = "take";
con.Close();
}
private void pankaj(object sender, EventArgs e)
{
con.Open();
string str = "insert into pankaj values('" + textBox2.Text + "')";
SqlCommand com = new SqlCommand(str, con);
com.ExecuteNonQuery();
con.Close();
call();
}
after each click i am find new data in combobox........
Durga VelusamyPosted Mar 26, 2015, 3:26 AM
example i have customername, phone ,address like that
if i save data using save option and i am retrieving data using search option using customername. after saving then sequentially i thought to retrieve it. only, the problem is i can retrieve, when i have given full name, but i cant get the name in combolist sequentially. it will be there after close application then open means then only the combobox is updated with last activity either saved data or deleted data .
Khargesh RajputPosted Mar 26, 2015, 3:04 AM
Durga VelusamyPosted Mar 26, 2015, 2:57 AM
why like that why i cann't get after store why it will not update spantaneously? after close the application then open the application means its there in the list.
Khargesh RajputPosted Mar 26, 2015, 2:40 AM