This documentation is archived and is not being maintained.

OleDbParameter.ParameterName Property

Gets or sets the name of the OleDbParameter.

[Visual Basic]
Public Overridable Property ParameterName As String  Implements _
   IDataParameter.ParameterName
[C#]
public virtual string ParameterName {get; set;}
[C++]
public: __property virtual String* get_ParameterName();
public: __property virtual void set_ParameterName(String*);
[JScript]
public function get ParameterName() : String;
public function set ParameterName(String);

Property Value

The name of the OleDbParameter. The default is an empty string.

Implements

IDataParameter.ParameterName

Remarks

The OLE DB .NET Provider uses positional parameters that are marked with a question mark (?) instead of named parameters.

Example

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

[Visual Basic] 
Public Sub CreateOleDbParameter()
    Dim myParameter As New OleDbParameter("Description", OleDbType.VarChar, 88)
    myParameter.Direction = ParameterDirection.Output
End Sub 'CreateOleDbParameter

[C#] 
public void CreateOleDbParameter() 
 {
    OleDbParameter myParameter = new OleDbParameter("Description", OleDbType.VarChar, 88);
    myParameter.Direction = ParameterDirection.Output;
 }

[C++] 
public:
void CreateOleDbParameter() 
 {
    OleDbParameter* myParameter = new OleDbParameter(S"Description", OleDbType::VarChar, 88);
    myParameter->Direction = ParameterDirection::Output;
 }

[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.

Requirements

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

See Also

OleDbParameter Class | OleDbParameter Members | System.Data.OleDb Namespace

Show: