Click here to Skip to main content
15,892,927 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute6-Jan-11 11:29
Henry Minute6-Jan-11 11:29 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC6-Jan-11 11:32
LAPEC6-Jan-11 11:32 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC6-Jan-11 11:57
LAPEC6-Jan-11 11:57 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute6-Jan-11 12:00
Henry Minute6-Jan-11 12:00 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC6-Jan-11 12:04
LAPEC6-Jan-11 12:04 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute6-Jan-11 13:07
Henry Minute6-Jan-11 13:07 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC6-Jan-11 13:23
LAPEC6-Jan-11 13:23 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute6-Jan-11 14:19
Henry Minute6-Jan-11 14:19 
Hi Roni,

Well, as I said in my last message think about all of the things that you want the application to do and decide which parts of each of those things you want to do for real and which of them you want to only do partially and simulate the rest. A lot of this will depend on if your application is for use in the real world or just for your education/amusement or whatever.

To use this 'showing the in-stock number on the buttons' feature as an example. (this is how I see it BTW, you may see it differently)

1 You want the number displayed.
2 It therefore makes sense for it to be there when the app starts up.
3 For that to happen the numbers should either be stored somehow and real numbers used or they should be totally made up so that every button gets say 10 at start up.
4 Should the number decrease every time that item is ordered.
5 If they decrease, what should happen when the number reaches zero. Should it automatically get topped back up to 10 or should the user have to do something. If automatic will they be real stock or just a number. If automatic and it is real stock what happens if there are none in stock to top up the button with. If the user has to do something should it be like it is now or might it be better if there was a context menu for each button with a 'Replenish Stock' item that would put up the InputBox type thing so that the user just tops up that button.

And so on. Once you have decided all these things you will have a better idea of what needs to be done.

As far as the separate project for the Data Access stuff is concerned. There are currently 4/5 or even more places where a OleDbConnection is created, used and then disposed. There should be just one method that returns an OleDbConnection when it is called (just for example lets say it is called GetConnection(). The ConnectionString should be stored in the *.config file (encrypted) and that should be the only one that is used. If a particular Form needs a list of the Starters it should call a method called something like GetCourseMenuData() and pass in a string "Starter" and get back a List, an Array or a DataTable with the data it needs. If another Form/UC needs the Desserts it should call GetCourseMenuData("Dessert"). GetCourseMenuData() should call GetConnection() and dispose of it when it is done. There should be no need to call GetConnection() from any of the Forms or UCs in the User Interface part of the Application.

By doing these things when there is a problem with getting a connection you know that the bug/problem can only be in one place in your code.

Have a think about it and let me know when you are ready to start and which part you want to start on. Even if you decide to carry on as it is now, I will try to help where I can.
Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!

GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC6-Jan-11 15:13
LAPEC6-Jan-11 15:13 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute7-Jan-11 11:16
Henry Minute7-Jan-11 11:16 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC7-Jan-11 13:21
LAPEC7-Jan-11 13:21 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC9-Jan-11 8:37
LAPEC9-Jan-11 8:37 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute9-Jan-11 8:38
Henry Minute9-Jan-11 8:38 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC9-Jan-11 8:41
LAPEC9-Jan-11 8:41 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute9-Jan-11 9:10
Henry Minute9-Jan-11 9:10 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC30-Jan-11 4:13
LAPEC30-Jan-11 4:13 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute10-Feb-11 13:20
Henry Minute10-Feb-11 13:20 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC10-Feb-11 13:41
LAPEC10-Feb-11 13:41 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC10-Feb-11 13:57
LAPEC10-Feb-11 13:57 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC9-Jan-11 8:52
LAPEC9-Jan-11 8:52 
QuestionHelp with UAC Issue Pin
Jammer16-Dec-10 8:15
Jammer16-Dec-10 8:15 
AnswerRe: Help with UAC Issue Pin
Jammer17-Dec-10 9:39
Jammer17-Dec-10 9:39 
Questionset url file Pin
ali_heidari_16-Dec-10 3:24
ali_heidari_16-Dec-10 3:24 
AnswerRe: set url file Pin
Hari Om Prakash Sharma16-Dec-10 3:53
Hari Om Prakash Sharma16-Dec-10 3:53 
QuestionI am read File and I want to get information from each 256 byte and from each 256 byte ? Pin
Honeyboy_2016-Dec-10 2:56
Honeyboy_2016-Dec-10 2:56 

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.