11/22/2024 11:55:56 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss using the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
|
|
|
|
After connection.open neither any exception nor return back, When data source is wrong?
Posted: 02 Apr 10 1:55 PM
|
Do anybody know why atfter Oledbconnection.open is executed with wrong datasource name in connection string neither it caught any exception nor returns back to the debugging mode? It seems it went to black hole. Now when I need to select data source from the list of servers , if there is one wrong server name then system hang on and I am being unable to trap that error. Any kind of help will be highly appreciable.
I have following code :
string connString = "Provider=SLXOLEDB.1; Data Source=WrongDatasourceName; Persist Security Info=True; User ID=Admin; Password=password;Initial Catalog=Test; Extended Properties='PORT=1706; LOG=ON; '" ;
using (OleDbConnection cn = new OleDbConnection(connString)) { try { cn.Open();//when the datasource is wrong it seems to stuck at this point. using (OleDbCommand cmd = new OleDbCommand(Resources.slxGetAliasListStoredProc, cn)) { using (OleDbDataReader rdr = cmd.ExecuteReader()) { while (rdr.Read()) { string alias = rdr.GetString(0); result.Add(alias); } } } } catch (Exception ex) {
throw new Exception(ex.Message); } finally { if (cn.State == System.Data.ConnectionState.Open) { cn.Close(); } } }
It doesn't caught any exception at all, but after execution of cn.Open() just hang on. This problem seems really weird.
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|