1
Reply

exceptions plz solve in c#

lalitha

lalitha

Jun 26 2009 1:51 PM
2.6k
this is my code: plz help error: not a valid file name public partial class fwnote : Form { public fwnote() { InitializeComponent(); } OleDbConnection con = new OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = DataDirectory\\E:\\parceldb.mdb"); // "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +sourceFile + ";Extended Properties=\"Excel 8.0;HDR=NO;\""; private void button1_Click(object sender, EventArgs e) { string str = "select * from train_details where place = Delhi"; OleDbCommand cmd = new OleDbCommand(str, con); con.Open(); OleDbDataReader dr = cmd.ExecuteReader(); if (dr.Read() == true) { MessageBox.Show(dr.GetValue(2).ToString()); } //MessageBox.Show("tn"); con.Close(); } } }

Answers (1)