asp.net.ph

OleDbCommand Constructor ( String )

System.Data.OleDb Namespace   OleDbCommand Class


Initializes a new instance of the OleDbCommand class with the text of the query.

[ VB ]
Overloads Public Sub New ( _
   ByVal cmdText As String _
)

[ C# ]
public OleDbCommand (
   string cmdText
);

[ C++ ]
public: OleDbCommand (
   String* cmdText
);

[ JScript ]
public function OleDbCommand (
   cmdText : String
);

Parameters

cmdText
The text of the query.

Remarks

The following table shows initial property values for an OleDbCommand instantiated with this constructor.

Properties Initial Value
CommandText cmdText
CommandTimeout 30
CommandType Text
Connection null

You can change the value for any of these parameters by setting the related property.

Example

The following example initializes an OleDbCommand with a given query.

string query = "SELECT * FROM Categories ORDER BY CategoryID";
OleDbCommand myCommand = new OleDbCommand ( query );
myCommand.CommandTimeout = 20;
  C# VB

See Also

OleDbCommand Members   OleDbCommand Constructor Overload List 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