Spread ASP.NET 6.0 Product Documentation
GetDataColumnName Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > IDataSourceSupport Interface : GetDataColumnName Method


column
Column index

Glossary Item Box

Gets the column name at the specified position.

Syntax

Visual Basic (Declaration) 
Function GetDataColumnName( _
   ByVal column As Integer _
) As String
Visual Basic (Usage)Copy Code
Dim instance As IDataSourceSupport
Dim column As Integer
Dim value As String
 
value = instance.GetDataColumnName(column)
C# 
string GetDataColumnName( 
   int column
)

Parameters

column
Column index

Return Value

String containing the name

Example

This example binds the model to a data set.
C#Copy Code
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";
dss.DataKeyField = "auid";

string s;
s = dss.GetDataColumnName(2);
Response.Write("The column name is " + s);
Visual BasicCopy Code
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"
dss.DataKeyField = "auid"

Dim s As String
s = dss.GetDataColumnName(2)
Response.Write("The column name is " & s)

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.