Duwamish Framework--Filling DataSet

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I'm trying to use the Duwamish 7.0 Framework to make a
distributed application.

I re-wrote parts of the application to work with Students
instead of Customers. So instead of a unique email
constraint I have a unique constraint on FirstName,
LastName, DateOfBirth combination.

Whenever I try to fill a brand new StudentData (instead of
CustomerData) object, I get the following error...
Failed to enable constraints. One or more rows contain
values violating non-null, unique, or foreign-key
constraints.

I debugged right down to the line of code where it
happens...
StudentData data = new StudentData();
//
// Get the load command
//
dsCommand.SelectCommand =
GetLoadCommandByNameAndDateOfBirth();
dsCommand.SelectCommand.Parameters[FIRST_NAME_PARM].Value
= FirstName;
dsCommand.SelectCommand.Parameters[LAST_NAME_PARM].Value =
LastName;
dsCommand.SelectCommand.Parameters
[DATE_OF_BIRTH_PARM].Value = DateOfBirth;

DataSet data2 = new DataSet();
dsCommand.Fill(data2); //this works all the time
dsCommand.Fill(data); //this doesn't work when the data
I'm searching exists in the database

Any ideas?

Thanks!
-Paul
 
Side Note: FirstName LastName and DateOfBirth IS NOT Unique.
that has nothing to do with your problem?
Might need to check things in your Database
 
Create a datarealation amongst the columns.

MS News (MS ILM) said:
Side Note: FirstName LastName and DateOfBirth IS NOT Unique.
that has nothing to do with your problem?
Might need to check things in your Database

Paul said:
I'm trying to use the Duwamish 7.0 Framework to make a
distributed application.

I re-wrote parts of the application to work with Students
instead of Customers. So instead of a unique email
constraint I have a unique constraint on FirstName,
LastName, DateOfBirth combination.

Whenever I try to fill a brand new StudentData (instead of
CustomerData) object, I get the following error...
Failed to enable constraints. One or more rows contain
values violating non-null, unique, or foreign-key
constraints.

I debugged right down to the line of code where it
happens...
StudentData data = new StudentData();
//
// Get the load command
//
dsCommand.SelectCommand =
GetLoadCommandByNameAndDateOfBirth();
dsCommand.SelectCommand.Parameters[FIRST_NAME_PARM].Value
= FirstName;
dsCommand.SelectCommand.Parameters[LAST_NAME_PARM].Value =
LastName;
dsCommand.SelectCommand.Parameters
[DATE_OF_BIRTH_PARM].Value = DateOfBirth;

DataSet data2 = new DataSet();
dsCommand.Fill(data2); //this works all the time
dsCommand.Fill(data); //this doesn't work when the data
I'm searching exists in the database

Any ideas?

Thanks!
-Paul
 
Back
Top