.NET Framework Class Library  

DataSet.DataSetName Property

Gets or sets the name of the current DataSet.

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

Property Value

The name of the DataSet.

Example

[Visual Basic, C#] The following example creates a new DataSet with the given DataSetName.

[Visual Basic] 
Private Sub CreateDataSet() 
   Dim myDataSet As DataSet
   myDataSet = New DataSet("SuppliersProducts")
   Console.WriteLine(myDataSet.DataSetName)
End Sub

[C#] 
private void CreateDataSet(){
   DataSet myDataSet = new DataSet("SuppliersProducts");
   Console.WriteLine(myDataSet.DataSetName);
   // Add a DataTable.
   myDataSet.Tables.Add(new DataTable("Suppliers"));
   // Add a DataColumn to the DataTable.
   myDataSet.Tables["Suppliers"].Columns.Add
   (new DataColumn("CompanyName", System.Type.GetType("System.String")));

}

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET

See Also

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