Your opinion please

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm currently creating a database class, which contains a member called
Open(). With this method users can open different databases. When a user
tries to open a database which happens to be secured with useraccounts
(username, password etc), the user should be notifed to login.

Now, in my opinion their are 3 ways to cope with situation:
1. Exit the method nicely with an errorcode (eg access denied, specify
accountinformation and try again)
2. Fire an exception
3. Fire an event (eg a LoginEvent, with cancel option) and wait until the
user specifies his username, password
etc within an exceptionhandler. This means that the Open() must wait
until the user responses.

I'm not looking for a good solution, but I'm more interested in opions with
good arguments.

Is there anybody out there who´s willing to share his opinion?

thnx

DD





.



Relevant Pages

  • Re: Enterprise Library and PostgreSQL (Npgsql)
    ... I found the database provider code at ... Catch ex As Exception ... If the connection string is invalid or the database server is ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework)
  • Object reference not set to an instance of an object.
    ... Object reference not set to an instance of an object. ... An unhandled exception occurred during the execution of the ... Dim myJobRequest As New skillsDB.jobRequest ... Session= "The skills database has been updated ...
    (microsoft.public.dotnet.general)
  • Object reference not set to an instance of an object.
    ... ASP.NET that uses web service for SQL Server 2000 DB access. ... Exception Details: System.NullReferenceException: Object reference not ... Dim myJobRequest As New skillsDB.jobRequest ... Session= "The skills database has been updated ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: SqlCeConnection
    ... data from the database using either a DataReader, DataSet, and binding the ... error but the Exception object does not contain a message to display. ... private void CloseConnection() ... SqlCeCommand sqlCommand = null; ...
    (microsoft.public.sqlserver.ce)
  • Re: error in accessing database
    ... Access requires the creation of an .ldb file when the database ... An unhandled exception occurred during the execution of the ... current web request. ...
    (microsoft.public.dotnet.framework.aspnet)