OleDbCommand Constructor (String)
.NET Framework (current version)
Initializes a new instance of the OleDbCommand class with the text of the query.
System.Data (in System.Data.dll)
The following table shows initial property values for an instance of OleDbCommand.
The following example creates an OleDbCommand and sets some of its properties.
public void CreateMyOleDbCommand()
string queryString = "SELECT * FROM Categories ORDER BY CategoryID";
OleDbCommand command = new OleDbCommand(queryString);
command.CommandTimeout = 20;
Return to top
Available since 1.1