1 out of 6 rated this helpful - Rate this topic

CommandType Enumeration

Specifies how a command string is interpreted.

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)
public enum CommandType
Member name Description
Supported by the XNA Framework Text An SQL text command. (Default.)
Supported by the XNA Framework StoredProcedure The name of a stored procedure.
Supported by the XNA Framework TableDirect The name of a table.

When the CommandType property is set to StoredProcedure, the CommandText property should be set to the name of the stored procedure to be accessed. The user may be required to use escape character syntax or include qualifying characters if any of the specified tables named contain any special characters. All rows and columns of the named table or tables will be returned when you call one of the Execute methods of a Command object.

When the CommandType property is set to TableDirect, the CommandText property should be set to the name of the table to be accessed. The user may be required to use escape character syntax or include qualifying characters if any of the tables named contain any special characters. All rows and columns of the named table will be returned when you call one of the Execute methods.

In order to access multiple tables, use a comma delimited list, without spaces or padding, containing the names of the tables to access. When the CommandText property names multiple tables, a join of the specified tables is returned.

Note Note

TableDirect is only supported by the .NET Framework Data Provider for OLE DB. Multiple table access is not supported when CommandType is set to TableDirect.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Please revise...
Yes Paulo, something definitely looks wrong there. Also, the 'Note' mentions multiple tables are not supported, but just above it does describe how to use it (comma seperated list). Finally, if it would be supported, it would be nice to know if foreign keys are used if they are defined because more often than not performing a cross join is not very useful.
Remarks on StoredProcedure mention tables instead of store procedures
The remarks text for StoredProcedure looks remarkably like the remarks text for TableDirect.