|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
ASP.Net/VB.Net - Want a logic......
hi!
i am developing back end form for uplaoding stories for our site.using asp.net and ms access. here the fields of the database are Month,Year,Volume No.,Issue No.,Story No.,country,headline,story and imgname. here the concept is Quote:
I want to upload story acc to this concpet. 1) if i upload story means the form should decide under which issue it should go. 2) after first 8 stories the Issue no. should be 2. like this it should grow acc to number of stories. 3) like this after 12 th issue the Volume no should be 2. like this it shuld grow acc to number of issues its fixed that each volume contains 12 issues only and each issues contains 12 stories only. pls tell me idea acc to this. Thank u in advance. |
|
#2
|
|||
|
|||
|
You could just do away with the Volume No and Issue No fields in your table and replace them with an autonumber ID field. Then you know that the first 8 stories are issue 1, the next 8 stories are issue 2, etc. You also know that the first 96 stories are volume 1, the next 96 volume 2 and so on.
This will be a problem if you delete stories but deleting stories with your current table design would cause similar issues as you'd have to reassign volume and issue numbers (unless you allowed issues/volumes to have < 8 or 96 stories when things are deleted). If you use the above you could retrieve any issue or volume from a simple calculation, e.g. all stories in volume 3, issue 5 could be retrieved with something like: SELECT <fields> FROM <table> WHERE ID > 2 * 96 + 4 * 8 AND ID <= 2 * 96 + 5 * 8 Or more generally: SELECT <fields> FROM <table> WHERE ID > (volume - 1) * 96 + (issue - 1) * 8 AND ID <= (volume - 1) * 96 + issue * 8 |
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > ASP.Net/VB.Net - Want a logic...... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|