lalitha

lalitha

  • NA
  • 11
  • 0

exceptions plz solve in c#

Jun 26 2009 1:51 PM
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)