Duwamish Framework--Filling DataSet

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
 
M

MS News \(MS ILM\)

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
 
V

Vai2000

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top