Click here to Skip to main content
15,878,852 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Update Settings in Winows Forms project Pin
Ron Mittelman28-Mar-23 11:57
Ron Mittelman28-Mar-23 11:57 
AnswerRe: Update Settings in Winows Forms project Pin
Ron Mittelman28-Mar-23 11:47
Ron Mittelman28-Mar-23 11:47 
GeneralRe: Update Settings in Winows Forms project Pin
Gerry Schmitz28-Mar-23 13:04
mveGerry Schmitz28-Mar-23 13:04 
QuestionASP.NET Core on Linux Web Space Pin
temuco24-Mar-23 3:05
professionaltemuco24-Mar-23 3:05 
AnswerRe: ASP.NET Core on Linux Web Space Pin
jschell27-Mar-23 6:43
jschell27-Mar-23 6:43 
AnswerRe: ASP.NET Core on Linux Web Space Pin
BillWoodruff30-May-23 18:56
professionalBillWoodruff30-May-23 18:56 
GeneralRe: ASP.NET Core on Linux Web Space Pin
temuco30-May-23 23:06
professionaltemuco30-May-23 23:06 
QuestionMy code keeps inserting duplicate records and I can't figure out why. Pin
Ihechi Alozie12-Mar-23 19:53
Ihechi Alozie12-Mar-23 19:53 
Hello dear experts,

I have been having sleepless nights trying to figure why my insert statements keep inserting duplicate records and at this point, I am so stumped that I could really, really use your superior skills to help me out.

First some background. I have been with this company for a little over two years and I was handed over an application that keeps breaking, mostly due to poor DB design.

I am asked to not discard the current DB design to "work with what I have."

The application accepts applications for request for some financial assistance but the applicant must meet certain conditions in order to be considered. If the applicant does not meet conditions, the application is rejected and returned to the applicant with reasons why it is rejected. The applicant is asked for adddress (install address and mailing address are requested.) there two key items to look for.
(1), Is Install address (residential address, same as mailing address?
(2), Is the application returned (rejected) or not.

So, here is what the code I am working with is supposed to do.

It searches the db for records and if record exists, then the code checks whether the application is rejected or not and is does install address same as mailing address or not.

The logic goes like this:

If applicant's address is same as mailing address (if SameAsMailing.Checked)
If record exists, then if SameAsMailing.Checked and returnyesorno.SelectedValue=0 Then install address is same as mailing address and it is not a return then update three tables (Addresses, Owner and Application tables).

If SameAsChecking is not checked and returnyesorno.SelectedValue=1 then install address is not same as mailing address, therefore, insert the both the install address and mailing address and also process for return by inserting records into Addresses, Owner, Application and return tables.

If install address is same as mailing address but not for return, then insert into Addresses, Owner and Application tables.

Finally, if install address is not the same as and also not a return then insert into Addresses, Owner and Application tables.

No matter the variation that I use, I keep getting about 4 duplicate records inserted into Addresses and Applications table.

It is a complicated mess and I need whatever help I can get from you superior talents, please.

Here is what makes it so complicated.

On the Addresses table, there are three key fields, AutoID (integer) Mailing and Installation are BIT datatypes.

If both Install address and mailing addresses are same, then both Mailing and Installation get value of 1 (true) and therefore AutoIID gets assigned same value.

If install address nd mailing address are different, Installation gets 1 and Mailing gets 0

Then on Applications table, there are two key fields, MailAddress and InstallAddress (both integer datatypes)

If Mailing and Installation (from Addresses table) both have a value of 1, then both MailAddress and InstallationAddress get the value of AutoID, say 123

If the Install Address is different from Mailing address, AutoID should get 123 for InstallAddress and 1234 for MailAddress.

I have tried various combinations of the insert statements but to no avail.

I have attached a copy of my code and it is very long.

I ask for your patience and assistance. Please help. I have delayed giving management demo and they have insisted that I show something by wednesday March 15th. Any assistance you could give would really, really be very helpful.

Thank you in advance for your patience and assistance.<a href="https://www.kenig-dev.tech/wp-content/uploads/2023/03/code.txt"></a>

Richard Deeming, could please help me? Sorry to call your name. I will just this time only because of my desparation.
AnswerRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Pete O'Hanlon13-Mar-23 0:38
mvePete O'Hanlon13-Mar-23 0:38 
GeneralRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Ihechi Alozie13-Mar-23 3:58
Ihechi Alozie13-Mar-23 3:58 
AnswerRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Gerry Schmitz13-Mar-23 7:24
mveGerry Schmitz13-Mar-23 7:24 
GeneralRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Ihechi Alozie13-Mar-23 7:37
Ihechi Alozie13-Mar-23 7:37 
GeneralRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Gerry Schmitz13-Mar-23 9:24
mveGerry Schmitz13-Mar-23 9:24 
AnswerRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Eddy Vluggen13-Mar-23 9:37
professionalEddy Vluggen13-Mar-23 9:37 
GeneralRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Ihechi Alozie13-Mar-23 9:56
Ihechi Alozie13-Mar-23 9:56 
GeneralRe: My code keeps inserting duplicate records and I can't figure out why. Pin
Eddy Vluggen13-Mar-23 10:11
professionalEddy Vluggen13-Mar-23 10:11 
QuestionIs there a need for separate SignInManager<TUser> and UserManager<TUser>? Pin
hpjchobbes26-Feb-23 8:24
hpjchobbes26-Feb-23 8:24 
AnswerRe: Is there a need for separate SignInManager<TUser> and UserManager<TUser>? Pin
Dave Kreskowiak26-Feb-23 9:45
mveDave Kreskowiak26-Feb-23 9:45 
AnswerRe: Is there a need for separate SignInManager<TUser> and UserManager<TUser>? Pin
Sardar Mudassar Ali Khan SSE10-Mar-23 6:33
professionalSardar Mudassar Ali Khan SSE10-Mar-23 6:33 
QuestionVb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
sdfsdfsdfewrew3feff26-Feb-23 6:37
sdfsdfsdfewrew3feff26-Feb-23 6:37 
AnswerRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
Richard Deeming26-Feb-23 22:31
mveRichard Deeming26-Feb-23 22:31 
GeneralRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
sdfsdfsdfewrew3feff27-Feb-23 6:55
sdfsdfsdfewrew3feff27-Feb-23 6:55 
GeneralRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
Richard Deeming27-Feb-23 21:17
mveRichard Deeming27-Feb-23 21:17 
AnswerRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
Dave Kreskowiak27-Feb-23 3:14
mveDave Kreskowiak27-Feb-23 3:14 
GeneralRe: Vb.net FlowLayoutPanel with MS Access: System.InvalidCastException error. Pin
sdfsdfsdfewrew3feff27-Feb-23 8:36
sdfsdfsdfewrew3feff27-Feb-23 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.