From: Date: May 6 2005 3:49pm Subject: bk commit - mysqldoc@docsrva tree (Mike.Hillyer:1.2633) List-Archive: http://lists.mysql.com/internals/24625 Message-Id: <200505061349.j46DnOSf016657@www.openwin.org> Below is the list of changes that have just been committed into a local mysqldoc repository of root. When root does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://www.mysql.com/doc/I/n/Installing_source_tree.html ChangeSet 1.2633 05/05/06 07:49:23 Mike.Hillyer@stripped +1 -0 Add MySqlException class, WIP Docs/connector-net.xml 1.12 05/05/06 07:49:22 Mike.Hillyer@stripped +161 -0 Added mysqlexception class to architecture section, WIP # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: Mike.Hillyer # Host: www.openwin.org # Root: /home/mysqldoc/mysqldoc --- 1.11/Docs/connector-net.xml 2005-05-06 05:53:50 -06:00 +++ 1.12/Docs/connector-net.xml 2005-05-06 07:49:22 -06:00 @@ -1510,6 +1510,167 @@ + + + The MySqlException Class + + + This class is created whenever the MySql Data Provider encounters an + error generated from the server. + + + + Any open connections are not automatically closed when an exception + is thrown. If the client application determines that the exception + is fatal, it should close any open MySqlDataReader objects or + MySqlConnection objects. + + + + + Properties + + + The following properties are available: + + + + + + HelpLink: Gets or sets a link to the help file + associated with this exception. + + + + InnerException: Gets the Exception instance + that caused the current exception. + + + + IsFatal: True if this exception was fatal and + cause the closing of the connection, false otherwise. + + + + Message: Gets a message that describes the + current exception. + + + + Number: Gets a number that identifies the type + of error. + + + + Source: Gets or sets the name of the + application or the object that causes the error. + + + + StackTrace: Gets a string representation of the + frames on the call stack at the time the current exception was + thrown. + + + + TargetSite: Gets the method that throws the + current exception. + + + + + + + + + + + Methods + + + The MySqlException class has no methods. + + + + + + + + + Usage + + + The following example generates a MySqlException due to a missing + server, and then displays the exception. + + + + + VB.NET + + + This example demonstrates how to use the MySqlException class with + VB.NET: + + + +Public Sub ShowException() + Dim mySelectQuery As String = "SELECT column1 FROM table1" + Dim myConnection As New MySqlConnection ("Data Source=localhost;Database=Sample;") + Dim myCommand As New MySqlCommand(mySelectQuery, myConnection) + + Try + myCommand.Connection.Open() + Catch e As MySqlException + MessageBox.Show( e.Message ) + End Try + End Sub + + + + + + + + + C# + + + This example demonstrates how to use the MySqlException class with + C#: + + + +public void ShowException() +{ + string mySelectQuery = "SELECT column1 FROM table1"; + MySqlConnection myConnection = + new MySqlConnection("Data Source=localhost;Database=Sample;"); + MySqlCommand myCommand = new MySqlCommand(mySelectQuery,myConnection); + + try + { + myCommand.Connection.Open(); + } + catch (MySqlException e) + { + MessageBox.Show( e.Message ); + } +} + + + + + + + + + + + + + +