Skip to end of metadata
Go to start of metadata

Description

Sets an ADO.NET DataTable as a data source to bind to template data markers.

C#
public void BindData(System.Data.DataTable dataTable, String dataSourceName, PowerPointWriter.DataBindingProperties bindingProperties)
vb.net
Public Overridable Sub BindData(ByVal dataTable As System.Data.DataTable, ByVal dataSourceName As String, ByVal bindingProperties As DataBindingProperties

Parameters

dataTable
The DataTable to use as the data source.
dataSourceName
The name of the data source.
bindingProperties
A DataBindingProperties object.

Examples

C#
          OleDbConnection Conn = new OleDbConnection();
          DataTable EmployeeDt = null;
          DataBindingProperties dataProps = pptt.CreateDataBindingProperties();
          try
          {
               Conn.ConnectionString = Application["connstring"].ToString();
 
               //--- SQL Query for employee information
               string EmployeeSQL = "SELECT FirstName + ' ' + " +
                    "LastName As Name, Title " +
                    "FROM Employees WHERE EmployeeID=?";
               OleDbCommand CmdEmployee = new OleDbCommand(EmployeeSQL, Conn);
               CmdEmployee.Parameters.Add("@EmployeeID", EmployeeId);
               OleDbDataAdapter AdptEmployee = new OleDbDataAdapter(CmdEmployee);
               EmployeeDt = new DataTable();
               AdptEmployee.Fill(EmployeeDt);
          }
          pptt.BindData(EmployeeDt,
               "Employee",
               dataProps);
vb.net
          Dim Conn As New OleDbConnection()
          Dim EmployeeDt As DataTable = Nothing
          Dim dataProps As DataBindingProperties = pptt.CreateDataBindingProperties()
          Try
               Conn.ConnectionString = Application("connstring").ToString()

               '--- SQL Query for employee information
               Dim EmployeeSQL As String = "SELECT FirstName + ' ' + " & _
                    "LastName As Name, Title " & _
                    "FROM Employees WHERE EmployeeID=?"
               Dim CmdEmployee As New OleDbCommand(EmployeeSQL, Conn)
               CmdEmployee.Parameters.Add("@EmployeeID", EmployeeId)
               Dim AdptEmployee As New OleDbDataAdapter(CmdEmployee)
               EmployeeDt = New DataTable()
               AdptEmployee.Fill(EmployeeDt)
          End Try
          pptt.BindData(EmployeeDt, _
               "Employee", _
               dataProps)
  • No labels