Click here to Skip to main content
15,895,656 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:04
Henry Minute6-Jan-11 11:04 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC6-Jan-11 11:28
LAPEC6-Jan-11 11:28 
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 
Think about a situation where the user of your application goes to the 'Manage->Stock In' screen and adds to the Soup, Olives and several other items. How can all that information be passed back so that it is available to the Soup button, the Olives button and all the others. Without a massive List<> or array it cannot really be done.

It might just be possible if there was a Dictionary<foodItem, quantity> with global scope so that both the 'Stock In' Form and the 'Starter Button UC' could 'see' it but then you would have a situation where the buttons for the items selected by the user (Soup, Olives etc) would have a number but none of the other buttons would. Which would look very odd! (I could show you how to do it this way, but I would not be helping you properly. I would be showing you bad practices, which I don't like doing.)

Also, so that the numbers would appear next time the app was started there would have to be some mechanism to serialize the dictionary when the app closed and deserialize it when the app starts up again. Very messy. It is a Database backed Application so use the Database instead. As things are, you are moving to the situation that causes applications to get to the stage where no-one can maintain them because there are work-arounds to get round the work-arounds to get round the work-arounds, and so on.

You should pause now and consider ALL of the features that you are going to want in this app and design a Database that will be able to cope with them. While you are paused you should also consider the fact that your project is getting incredibly large, not over all but the number of files it contains. There is a very strong case here for removing all of the Data Access code from the current forms and putting it into a separate project. The Forms and UCs would then call a method in that project and have a DataTable, or List/Array depending on their needs, returned that they would work with.
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 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 
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 

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.