asp.net.ph

SqlConnection.ServerVersion Property

System.Data.SqlClient Namespace   SqlConnection Class


Returns a string containing the version of the of the server to which the client is connected.

Syntax


Script [ string variable = ] SqlConnection.ServerVersion

Property Value


variable Returns the version of the connected server.

The property is read only with no default value.

Exceptions


Exception Type Condition
InvalidOperationException Occurs when the connection is closed.

Remarks

The string representation of the version is of the form major.minor.build ( ##.##.#### ), where the first two digits are the major version, the next two digits are the minor version, and the last four digits are thr build or release version.

Example

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

"Provider: " + myConn.Provider;
  C# VB

 Show me 

See Also

SqlConnection Members Skip Navigation Links


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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