Class DataCommand
Represents a Transact-SQL statement or stored procedure to execute against a SQL Server database.
Inheritance
Implements
Namespace: Cuemon.Data
Assembly: Cuemon.Data.dll
Syntax
public class DataCommand : IDataCommand
Constructors
| Improve this DocDataCommand()
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand()
DataCommand(String)
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The command text to execute. |
DataCommand(String, CommandType)
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string text, CommandType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The command text to execute. |
System.Data.CommandType | type | The command type value to execute. |
DataCommand(String, CommandType, Object[])
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string textFormat, CommandType type, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | textFormat | The command text to execute as a composite format string (see Remarks). |
System.Data.CommandType | type | The command type value to execute. |
System.Object[] | args | An object array that contains zero or more objects to format. |
Remarks
For more information regarding the textFormat
, have a look here: http://msdn.microsoft.com/en-us/library/txafckwd(v=vs.80).aspx.
DataCommand(String, CommandType, TimeSpan)
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string text, CommandType type, TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The command text to execute. |
System.Data.CommandType | type | The command type value to execute. |
System.TimeSpan | timeout | The timeout for the command to execute. |
DataCommand(String, CommandType, TimeSpan, Object[])
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string textFormat, CommandType type, TimeSpan timeout, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | textFormat | The command text to execute as a composite format string (see Remarks). |
System.Data.CommandType | type | The command type value to execute. |
System.TimeSpan | timeout | The timeout for the command to execute. |
System.Object[] | args | An object array that contains zero or more objects to format. |
Remarks
For more information regarding the textFormat
, have a look here: http://msdn.microsoft.com/en-us/library/txafckwd(v=vs.80).aspx.
DataCommand(String, Object[])
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string textFormat, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | textFormat | The command text to execute as a composite format string (see Remarks). |
System.Object[] | args | An object array that contains zero or more objects to format. |
Remarks
For more information regarding the textFormat
, have a look here: http://msdn.microsoft.com/en-us/library/txafckwd(v=vs.80).aspx.
DataCommand(String, TimeSpan)
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string text, TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The command text to execute. |
System.TimeSpan | timeout | The timeout for the command to execute. |
DataCommand(String, TimeSpan, Object[])
Initializes a new instance of the DataCommand class.
Declaration
public DataCommand(string textFormat, TimeSpan timeout, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | textFormat | The command text to execute as a composite format string (see Remarks). |
System.TimeSpan | timeout | The timeout for the command to execute. |
System.Object[] | args | An object array that contains zero or more objects to format. |
Remarks
For more information regarding the textFormat
, have a look here: http://msdn.microsoft.com/en-us/library/txafckwd(v=vs.80).aspx.
Properties
| Improve this DocDefaultTimeout
Gets or sets the default wait time before terminating the attempt to execute a command and generating an error.
Declaration
public static TimeSpan DefaultTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan | The System.TimeSpan to wait for the command to execute. Default value is 1 minute and 30 seconds. |
Text
Gets or sets the command text to execute.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | The command text to execute. |
Timeout
Gets or sets the wait time before terminating the attempt to execute a command and generating an error.
Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan | The timespan to wait for the command to execute. Default value is 1 minute and 30 seconds. |
Type
Gets or sets the command type value to execute.
Declaration
public CommandType Type { get; set; }
Property Value
Type | Description |
---|---|
System.Data.CommandType | The command type value to exceute. Default type value is Text. |