NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataTable.TableName

Gets or sets the name of the table.

[Visual Basic]
Public Property TableName As String
[C#]
public string TableName {get; set;}
[C++]
public: __property String* get_TableName();
public: __property void set_TableName(String*);
[JScript]
public function get TableName() : String;
public function set TableName(String);

Property Value

The name of the table.

Exceptions

Exception Type Condition
ArgumentException A a null reference (in Visual Basic Nothing) or empty string ("") is passed in and this table belongs to a collection.
DuplicateNameException The table belongs to a collection that already has a table with the same name (and the comparison is not case-sensitive).

Remarks

The TableName is used to return this table from the parent DataSet object's TablesCollection (returned by the Tables property).

Example [Visual Basic]

The following example prints the TableName for each table in a collection of DataTable objects.

[Visual Basic]

Private Sub GetTableNames()
   Dim t As DataTable
   Dim cols As TablesCollection
   ' Set cols to a DataSet object's Tables collection.
   cols = myDataSet.Tables
   ' Print each table's TableName.
   For Each t in cols
      Console.WriteLine(t.TableName)
   Next
End Sub

See Also

DataTable Class | DataTable Members | System.Data Namespace | DataSet | Tables