SqlException.LineNumber Property

 

Gets the line number within the Transact-SQL command batch or stored procedure that generated the error.

Namespace:   System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)

member LineNumber : int with get

Property Value

Type: System.Int32

The line number within the Transact-SQL command batch or stored procedure that generated the error.

The line numbering starts at 1; if 0 is returned, the line number is not applicable.

This is a wrapper for the LineNumber property of the first SqlError in the Errors property.

The following example displays each SqlError within the SqlErrorCollection collection.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: