Spread for ASP.NET 11 Product Documentation
DataMember Property (IDataSourceSupport)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > IDataSourceSupport Interface : DataMember Property
Gets or sets the data member (table name).
Syntax
'Declaration
 
Property DataMember As String
'Usage
 
Dim instance As IDataSourceSupport
Dim value As String
 
instance.DataMember = value
 
value = instance.DataMember
string DataMember {get; set;}

Property Value

String containing the data member
Example
This example binds the model to a data set.
string strConn  = "data source = 127.0.0.1;initial catalog=Pubs; integrated security = SSPI";
string sqlStr = "SELECT * FROM Authors; Select * From Titles";

System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter(sqlStr, strConn);
DataSet ds = new DataSet();
da.Fill(ds);

FarPoint.Web.Spread.Model.IDataSourceSupport dss;
dss = (FarPoint.Web.Spread.Model.IDataSourceSupport)FpSpread1.ActiveSheetView.DataModel;
dss.AutoGenerateColumns = true;
dss.DataSource = ds;
dss.DataMember = "Table";
Dim strConn As String = "data source = 127.0.0.1;initial catalog=Pubs; integrated security = SSPI"
Dim sqlStr As String = "SELECT * FROM Authors; Select * From Titles"

Dim da As New System.Data.SqlClient.SqlDataAdapter(sqlStr, strConn)
Dim ds As New DataSet
da.Fill(ds)

Dim dss As FarPoint.Web.Spread.Model.IDataSourceSupport
dss = FpSpread1.ActiveSheetView.DataModel
dss.AutoGenerateColumns = True
dss.DataSource = ds
dss.DataMember = "Table"
See Also

Reference

IDataSourceSupport Interface
IDataSourceSupport Members