Hi all,
Im using an OpenFileDialog to find a file and open it in my windows form application. I trying to specify the file i want to select which is an excel file " Partitions.xlsx" and return an error if this file (or any other file) i have selected is not equal to the excel file i want it to be ( ="Partitions.xlsx"). As i do not want the wrong file to be loaded!!
any help please?!
iv included my code that im using at the moment below:
DataTable dt; OleDbConnection conn; OleDbDataAdapter mydataAdapter; private void button1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.textBox1.Text = openFileDialog1.FileName; } }
Thanks!!
regards Ky