SQL : InsertRow() to accept a complete row instead of seperate parameters RRS feed

  • Question

  • I'm creating a database and I just added a new method to insert a row into my table via the the tableadapter->Add SQL :

    tblMachinesTableAdapter.Insert(MachineIDNumber, MachineName, ...);


    But I would like to change that method so it accepts a complete row as a parameter instead of all seperate strings and ints like this :

    Machinepark_NVVetex_DataSet.tblMachinesRow row = machinepark_NVVetex_DataSet.tblMachines.NewtblMachinesRow();
    row.MachineIDNumber = addMachineDlg.MachineIDNumber;
    row.MachineName = addMachineDlg.MachineName;
    row.MachineInfo = addMachineDlg.MachineInfo;
    row.MachinePowerConsumption = addMachineDlg.MachineInstalledPower;
    row.MachineVoltage = addMachineDlg.MachineVoltage;
    row.MachineBuildYear = addMachineDlg.MachineBuildYear;
    row.MachineCategory = addMachineDlg.MachineCategory;

    How do I do this?
    Sunday, September 30, 2007 9:02 AM

All replies