Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,149,914 members, 7,806,656 topics. Date: Tuesday, 23 April 2024 at 07:57 PM

Updating A Users Row - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Updating A Users Row (845 Views)

Entity Framework Vs Ado.net With TVP Updating Multiple Rows / Simulate Updating A Record Using Mockjax / Updating A Row (2) (3) (4)

(1) (Reply) (Go Down)

Updating A Users Row by skyhighweb(m): 1:50pm On May 07, 2017
hello programmers am having an update issue and i dont know how to go about it am gonna try n explain it the way i can plz bear with me.
i have a table called bids and two important column called bidder and tagged

when (bidder 5) has no one to tag he simple drops a bid and when another bidder comes along(bidder 3) he tags (bidder 5) i want bidder 5 row to update showing (bidder 3)in his row.

for example
bidder 5 place bid it looks like this
column

bidder ...........tagged
5.................... 0
no one to tag so it shows zero

so if bidder 5 finally get tagged by someone (bidder 3) it update showing the person that tag bidder 5 and it will look like this

column
roll for bidder 5 will look like this

bidder...............tagged
5 .......................3

complete row with bidder5 and bidder 3

bidder...............tagged
5 .......................3
3.......................5

hope u understand
Re: Updating A Users Row by AntiWailer: 1:56pm On May 07, 2017
Check your database table design structure.


This is how i will rather implement it.

I will have 2 tables.

- Bidder ===== To store details of every eligible bidder in my system

- BidderTags ==== To store all biddings and Tags.


Now each of the table will have the following fields :

== > BidderTable
BidderId - A unique Id of bidders {Primary Keys}
BidderName -- Full Name of the bidder
....... All other bidder related fields/data


==> BidderTagTable
BidderTagId ===AutoNumber that can act as Primary Key
BidderId === The Unique of the bidder in the system. a Foriegn Key to the BidderId in the Bidder Table.
BidderTagged === The Id of the bidder that was tagged
Active === A boolean value that indicates if this record is still ok or not
......... Other information related to the BidderTag (Dates, amount etc )

So when a bidder tags another bidder, you just drop a record in your BidderTag Table.

To know the number of tags a bidder have, run : "SELECT count(*) FROM BidderTagTable WHERE BidderTagged = 00005 AND Active = true"


You can even join the table to know the names of those who tagged him. You dont have to keep updating any row so you can keep logs for audit purpose.


Try read up on Database Normalization and understand the concept, you will not be having this kind of problem.


I hope this helps.

1 Like 1 Share

Re: Updating A Users Row by skyhighweb(m): 2:55pm On May 07, 2017
AntiWailer:
Check your database table design structure.


This is how i will rather implement it.

I will have 2 tables.

- Bidder ===== To store details of every eligible bidder in my system

- BidderTags ==== To store all biddings and Tags.


Now each of the table will have the following fields :

== > BidderTable
BidderId - A unique Id of bidders {Primary Keys}
BidderName -- Full Name of the bidder
....... All other bidder related fields/data


==> BidderTagTable
BidderTagId ===AutoNumber that can act as Primary Key
BidderId === The Unique of the bidder in the system. a Foriegn Key to the BidderId in the Bidder Table.
BidderTagged === The Id of the bidder that was tagged
Active === A boolean value that indicates if this record is still ok or not
......... Other information related to the BidderTag (Dates, amount etc )

So when a bidder tags another bidder, you just drop a record in your BidderTag Table.

To know the number of tags a bidder have, run : "SELECT count(*) FROM BidderTagTable WHERE BidderTagged = 00005 AND Active = true"


You can even join the table to know the names of those who tagged him. You dont have to keep updating any row so you can keep logs for audit purpose.


Try read up on Database Normalization and understand the concept, you will not be having this kind of problem.


I hope this helps.




can't i work on one table with this? dont really get what u said.
Re: Updating A Users Row by AntiWailer: 2:56pm On May 07, 2017
skyhighweb:
can't i work on one table with this? dont really get what u said.

You will have problems like the one are facing with 1 table.

Read normalization.

U need minimum of 2 tables for what u are doing.


Can you tell me what you dnt get may be I can explain further ?
Re: Updating A Users Row by skyhighweb(m): 4:42pm On May 07, 2017
can u pm me thanks
Re: Updating A Users Row by bet9ja(m): 8:53pm On May 07, 2017
All u need is to search for  Database Normalization and understand the concept, as a matter of facts, u need to learn best practice as this will point u to the right direction.

(1) (Reply)

Wordpress Website By AVADA Theme ! / Oya Am Less Busy Now Drop Your Website Link / Learn Programming

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.