Spread ASP.NET 15
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / IDataSourceSupport Interface / GetDataView Method
Whether to recreate the DataView

In This Topic
    GetDataView Method (IDataSourceSupport)
    In This Topic
    Gets the DataView object.
    Function GetDataView( _
       ByVal create As Boolean _
    ) As DataView
    Dim instance As IDataSourceSupport
    Dim create As Boolean
    Dim value As DataView
    value = instance.GetDataView(create)
    DataView GetDataView( 
       bool create


    Whether to recreate the DataView

    Return Value

    DataView object containing the view
    This example binds the model to a data set.
    string strConn  = "data source =;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();
    FarPoint.Web.Spread.Model.IDataSourceSupport dss;
    dss = (FarPoint.Web.Spread.Model.IDataSourceSupport)FpSpread1.ActiveSheetView.DataModel;
    dss.AutoGenerateColumns = true;
    dss.DataSource = ds;
    dss.DataMember = "Table";
    dss.DataKeyField = "auid";
    DataView dv;
    dv = dss.GetDataView(false);
    Response.Write("The name of the table in the data view is " + dv.Table.ToString());
    Dim strConn As String = "data source =;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
    Dim dss As FarPoint.Web.Spread.Model.IDataSourceSupport
    dss = FpSpread1.ActiveSheetView.DataModel
    dss.AutoGenerateColumns = True
    dss.DataSource = ds
    dss.DataMember = "Table"
    dss.DataKeyField = "auid"
    Dim dv As DataView
    dv = dss.GetDataView(False)
    Response.Write("The name of the table in the data view is " & dv.Table.ToString())
    See Also