asp.net.ph

SqlConnection.WorkstationId Property

System.Data.SqlClient Namespace   SqlConnection Class


Returns a string that identifies the database client.

Syntax


Script [ tring variable = ] SqlConnection.WorkstationId

Property Values


variable Returns a string that identifies the database client. If not specified, the name of the client computer.

The property is read only with no default value.

NOTE: You can change the value for this property only by setting the corresponding Workstation ID keyword in the ConnectionString property.

Exceptions


Exception Type Condition
InvalidOperationException Occurs when the connection is open ( you must first close the connection ), or the connection is broken.

Remarks

The string typically contains the network name of the client. The WorkstationId property corresponds to the Workstation ID connection string property.

NOTE: This property is read-only while the connection is open.

Example

The following example shows the simplest way to retrieve and display the WorkstationId property of the current connection.

"Workstation Id: " + myConn.WorkstationId;
  C# VB

 Show me 

See Also

SqlConnection Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph