Offset Property

SqlParameter.Offset Property

Gets or sets the offset to the Value property.

[Visual Basic]
Public Property Offset As Integer
public int Offset {get; set;}
public: __property int get_Offset();
public: __property void set_Offset(int);
public function get Offset() : int;
public function set Offset(int);

Property Value

The offset to the Value. The default is 0.


The Offset property is used for client-side chunking of binary and string data. For example, in order to insert 10MB of text into a column on a server, a user might execute 10 parameterized inserts of 1MB chunks, shifting the value of Offset on each iteration by 1MB.

This property is used for binary and string types. It returns the number of bytes for binary types, and the number of characters for strings. The count for strings does not include the terminating character.


[Visual Basic, C#, C++] The following example creates a SqlParameter and sets some of its properties.

[Visual Basic] 
Public Sub CreateSqlParameter()
    Dim myParameter As New SqlParameter("@Description", SqlDbType.VarChar)
    myParameter.IsNullable = True
    myParameter.Offset = 3
End Sub 'CreateSqlParameter

public void CreateSqlParameter() 
    SqlParameter myParameter = new SqlParameter("@Description", SqlDbType.VarChar);
    myParameter.IsNullable = true;
    myParameter.Offset = 3;

void CreateSqlParameter() 
    SqlParameter* myParameter = new SqlParameter(S"@Description", SqlDbType::VarChar);
    myParameter->IsNullable = true;
    myParameter->Offset = 3;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

SqlParameter Class | SqlParameter Members | System.Data.SqlClient Namespace

© 2015 Microsoft