textbox data entry

  • Thread starter Norm Bohana via DotNetMonster.com
  • Start date
N

Norm Bohana via DotNetMonster.com

I enter data into several textbox's. and try to save it to a SQL table using the following code:

Before this code is executed I do a 'sqlDataAdapter->Clear', and then enter the new data.

private: System::Void btnOSave_Click(System::Object * sender, System::EventArgs * e)
{
void UpdateDataSet(DataSet* dsOwnerAnimal1);

// Check for changes to the dataset

if(!dsOwnerAnimal1->HasChanges(DataRowState::Modified)) return;

MessageBox::Show("we got here 2");

// Create a temporary Dataset
DataSet* xOwner;

MessageBox::Show("we got here 3");

// Get the changes to the data (Modified Rows Only)
xOwner = dsOwnerAnimal1->GetChanges(DataRowState::Modified);

MessageBox::Show("we got here 4");


// Check the Dataset for Errors
if(xOwner->HasErrors) {
MessageBox::Show("There were Errors, Did not Update!");
return;
}

This does not work because I get no data into the dsOwnerAnimal1 dataset. Can someone tell me what I am doing wrong?

Norm
 
F

Frankie

The dataadapter does not have a clear method, are you sure your not clearing
the data out of your dataset? What does the code that fills the dataset look
like?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top