r

r

  • NA
  • 4
  • 0

updating a database using datasets

Feb 22 2008 4:12 PM

attempting to update my database using this code.

TestingTableAdapter tAdapter = new TestingTableAdapter();

testingDataSet tDS = new testingDataSet();

public Form1()

{

InitializeComponent();

this.tAdapter.Fill(tDS.myTestTable);

testingDataSet_TestingDataTableBindingSource.DataSource = tAdapter.GetData();

}

private void testingDataSet_TestingDataTableBindingNavigatorSaveItem_Click(object sender, EventArgs e)

{

this.Validate();

testingDataSet_TestingDataTableBindingSource.EndEdit();

this.tAdapter.Update(this.tDS.MyTestTable);

}

 

My database and dataset was created in another project file, which i added reference to this project. Basically attempting to layer this, but for some reason it will not update the database. Im wondering if it's because its using another dataset thats in the other project? Im sure the code is right, but I guess i don't have a clear understanding of whats actually happening here.

Any ideas of what my problem is?


Answers (1)