Click to See Complete Forum and Search --> : What if oleDb throw an Exception


didadada
January 26th, 2005, 06:04 AM
i can't connect to my database the OLEDB throw the following error

An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

How can you handel it

thanks

Andy Tacker
January 28th, 2005, 06:40 AM
to catch the exception you should use the try catch statements...

try{
My_OleDBConnection.Open();
}
catch(OleDbException m_Ex)
{
Messagebox.Show(m_Ex.Message);
}
Finally
{
//free resource here...
}