question about oleDbDataAdapter1.TableMappings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Claudia Fong

    question about oleDbDataAdapter1.TableMappings


    Hi,

    the using a DataAdapter to connect to a database which has tables
    according to year, for example
    dep2005, dep2004. I have a comboBox that contains the years
    (2005,2004,2003 ). The user will choose from the comboBox the year that
    he wants to view.

    The Data Adapter will look for the table according to what user chose.


    this.oleDbDataA dapter1.TableMa ppings.AddRange (new
    System.Data.Com mon.DataTableMa pping[] {

    new System.Data.Com mon.DataTableMa pping("Table", "DEPT2004", --- I want
    to change this to DEPTY, where y is the variable that contains the value
    of the year, 2004,2003

    new System.Data.Com mon.DataColumnM apping[] {

    new System.Data.Com mon.DataColumnM apping("DEP_COD E", "DEP_CODE") ,

    new System.Data.Com mon.DataColumnM apping("DEP_NAM E", "DEP_NAME") )),


    What should I do? Anu suggestions?

    Cheers!

    Claudi

    *** Sent via Developersdex http://www.developersdex.com ***
Working...