Quoted Property (DbDataTable)
Gets or sets whether the
DbDataTable quotes all the names of data source objects.
public bool Quoted {get; set;}
'Declaration
Public Property Quoted As Boolean
Property Value
true if the
DbDataTable will quote all the names of data source objects; otherwise,
false. The default value is
false.
The following example demonstrates how to use the
Quoted property.
static void UseDataTable(DbDataTable myDataTable, DbConnection myConnection) {
myDataTable.Connection = myConnection;
myDataTable.SelectCommand = myConnection.CreateCommand();
myDataTable.SelectCommand.CommandText = "SELECT * FROM \"DeptMixedCase\"";
myDataTable.Quoted = true;
myDataTable.FetchAll = true;
myDataTable.CachedUpdates = false;
myDataTable.Open();
DataRow row = myDataTable.Rows[0];
row[myDataTable.Columns["DNAME"]] = "Departament1";
myDataTable.Update();
myDataTable.Close();
}
Private Shared Sub UseDataTable(ByVal myDataTable As DbDataTable, ByVal myConnection As DbConnection)
myDataTable.Connection = myConnection
myDataTable.SelectCommand = myConnection.CreateCommand
myDataTable.SelectCommand.CommandText = "SELECT * FROM ""DeptMixedCase"""
myDataTable.Quoted = True
myDataTable.FetchAll = True
myDataTable.CachedUpdates = False
myDataTable.Open()
Dim row1 As DataRow = myDataTable.Rows.Item(0)
row1.Item(myDataTable.Columns.Item("DNAME")) = "Departament1"
myDataTable.Update()
myDataTable.Close()
End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2