Spread Windows Forms 6.0 Product Documentation
DefaultSheetDataModel Constructor(DataSet,String)
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class > DefaultSheetDataModel Constructor : DefaultSheetDataModel Constructor(DataSet,String)


dataSource
Data source to be used for this model
dataMember
Data table name

Glossary Item Box

Creates a default data model with the specified data set.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal dataSource As DataSet, _
   ByVal dataMember As String _
)
Visual Basic (Usage)Copy Code
Dim dataSource As DataSet
Dim dataMember As String
 
Dim instance As New DefaultSheetDataModel(dataSource, dataMember)
C# 
public DefaultSheetDataModel( 
   DataSet dataSource,
   string dataMember
)

Parameters

dataSource
Data source to be used for this model
dataMember
Data table name

Example

This example creates a new default sheet data model using the specified data set and data table.
C#Copy Code
string conStr  = "Provider=Microsoft.JET.OLEDB.4.0;data source=D:\\nwind.mdb";
string sqlStr = "SELECT * FROM Orders";
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(conStr);
DataSet ds = new DataSet();
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(sqlStr, conn);
da.Fill(ds, "Orders");
FarPoint.Win.Spread.Model.DefaultSheetDataModel dataModel = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(ds, "Orders");
fpSpread1.ActiveSheet.Models.Data = dataModel;
Visual BasicCopy Code
Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=D:\\nwind.mdb"
Dim sqlStr As String = "SELECT * FROM Orders"
Dim conn As New System.Data.OleDb.OleDbConnection(conStr)
Dim ds As DataSet = New DataSet()
Dim da As New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
da.Fill(ds, "Orders")
Dim dataModel As New FarPoint.Win.Spread.Model.DefaultSheetDataModel(ds, "Orders")
FpSpread1.ActiveSheet.Models.Data = dataModel

Requirements

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

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.