i need to ask one more question....
private void bbn_Click(object sender, EventArgs e)
{
OleDbDataAdapter ad;
DataSet ds1 = new DataSet();
if (comboBox1.SelectedIndex == 0)
{
string str1 = "select * from '"+comboBox1.SelectedIndex+"'";
OleDbConnection conn1 = new OleDbConnection(str);
ad = new OleDbDataAdapter(str1, conn1);
ad.Fill(ds1);
dataGridView1.DataSource = ds1.Tables[0].DefaultView;
i want the button to select the data from combo box and then display the corresponding table in grid view...
however its giving me an error
ad.Fill(ds1)
here...
it says syntax error..i know i need to write table name there...but i want it to read it from my
combobox.seleted index
....
Any suggestions....
thanks and regards