I was thinking to post this in WPF forum, but to the best of my knowledge this is pure c# issue.
I have application (WPF) that display values in listbox. I am using SQLite. On the form I have simple buttons named: ADD, EDIT and DELETE. So, just a simple ordinary page.
Every buttons carries a connection code:
Java |
You can imagine how ugly does it luck having code repetition, so I thought to use classes.
I tried making a static class with a method that contains the above mentioned code. Problem is tbl value. I cant return a tbl. I tried converting it to string and returning it. That works, but string shows nothing.
After thinking i come to an idea to have to classes. First class will be called from main code and will contain this:
Java |
Also i thought to create additional static class, in which I will have only this:
Java |
And in main code do this:
Code |
Please help me with this. I might be close to solution or totally in wrong direction, I really do not know.
Can you please provide me with your solution, or point me to errors in my solution.
Much appreciated.

Aaron Colen30 reputationPosted May 13, 2010, 8:32 AM EDT
ie
And then from your button:
vedran16 reputationPosted May 13, 2010, 10:03 AM EDT
I got this sorted now :)