2
2G
Hi,
I have one project containing all classes that access my db.
In another project I have some usercontrols that use these classes to access
the db and one of these usercontrols contains the following function:
private void cmdSImage_Click(object sender, System.EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "Select a image";
//ofd.Filter = "All files (*.*)|*.png;*.gif|PNG files (*.png)|*.png|GIF
files (*.gif)|*.gif" ;
if(ofd.ShowDialog()==DialogResult.OK)
{
// bimage = ofd.FileName.Substring(ofd.FileName.LastIndexOf("\\")+1);
//// FileStream fs = File.Open(ofd.FileName, FileMode.Open,
FileAccess.Read);
//// pctImage.Image = Image.FromStream(fs);
//// fs.Close();
}
ofd.Dispose();
}
Now here's the problem, from the moment I execute this by pressing on
cmdSImage and select a image and press ok , all my classes that access the
db fail on this.DBConn.Open(); where they open the dbconn and always get
following error :
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred
in system.data.dll
I just can't find what's wrong with it since this has nothing to do with my
dbconn and have also tried to completly rebuild the solution creating all
the project again and adding the existing classes but that also didn't help.
Anyone that may have a clue what's wrong ?
Thanks.
I have one project containing all classes that access my db.
In another project I have some usercontrols that use these classes to access
the db and one of these usercontrols contains the following function:
private void cmdSImage_Click(object sender, System.EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "Select a image";
//ofd.Filter = "All files (*.*)|*.png;*.gif|PNG files (*.png)|*.png|GIF
files (*.gif)|*.gif" ;
if(ofd.ShowDialog()==DialogResult.OK)
{
// bimage = ofd.FileName.Substring(ofd.FileName.LastIndexOf("\\")+1);
//// FileStream fs = File.Open(ofd.FileName, FileMode.Open,
FileAccess.Read);
//// pctImage.Image = Image.FromStream(fs);
//// fs.Close();
}
ofd.Dispose();
}
Now here's the problem, from the moment I execute this by pressing on
cmdSImage and select a image and press ok , all my classes that access the
db fail on this.DBConn.Open(); where they open the dbconn and always get
following error :
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred
in system.data.dll
I just can't find what's wrong with it since this has nothing to do with my
dbconn and have also tried to completly rebuild the solution creating all
the project again and adding the existing classes but that also didn't help.
Anyone that may have a clue what's wrong ?
Thanks.