The question implies you have no experience at all in software development. One of the most important rules is "seperation of concerns". Basically you divide a problem in smaller problems and solve them one by one. In this case, connecting database records directly to a grid is just not done.
The question implies you have not done any research on the subject, which also implies you're taking the easy road.
To answer your question and hoping you will first start reading a book or getting some classes before diving in database development:
You need to create some sort of DAL (DataAccess Layer) that will connect to the database and is able to perform several actions (CRUD eg, look that up in google). In your case getting data back into the application. One of my articles explains this and has sample code. Building a Framework - Part I (DAL)[^]
Once you have the data you should not connect it to the grid directly, rather create underlying objects that are useful. These objects can do little (just copy data to the object) or a lot (combining data, checking, reformatting, ...). That is done in the BLL (Business Logic Layer).
Finally, when you have done that and you have a desirable list of objects you can bind that to the grid in the GUI (Graphical User Interface).
This is about the most basic (3-tier) model you can do, there are many more additional models/layers, design patterns you can add/do.
Seriously, if your intent is to go for a professional career, start out with the "hello world" program and build up from there.
when i run this code i was able to see the application but when choose the file to load an exception error occurs i.e system.badimagee exception error (not a valid win32 application) .
I need to load .poly files or .png help me out please
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
And what you have done so far is ring up the garage, say "my car broke" and put the phone down... How long do you think you will be waiting beside the road in the middle of nowhere until they turn up with exactly the right part to fix your car?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
That's too much code to go through. You should have only shared relevant code and marked the line where the error is.
Looking at the message, you are trying to read a character at some location in the string. The location index is larger than string length. Following demonstrates what you are doing, somewhere in your code:
string hello = "hello"; // This is a string with 5 characters and hence length = 5. Since index is zero based, maximum you can look for is hello.char someCharacter = hello; // You are trying to read 11th character which obviously does not exist and hence will throw exception
"You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this goddamn clusterfuck.", BruceN[^]
Well, there you go - lots of places where you use Substring but don't check to see if you have strings of that length. You know, as each of these tests appears to start at the first character, you could just use StartsWith instead. If you don't do that, you're going to have to check the length of the string in each case.
Which code? You didn't show any. If you're referring to the code of some article here on CodeProject then you chose the wrong forum: Post your question on the message board of the article instead (which you'll find at the bottom of its page).
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Hello, dear forum.
I have a problem programming on C#. My recent activities with C++ are back over 20 years.
I downloaded from the internet a server/client-solution for SQLite and am stuck in my C#-application using this dll.
Then (unless I have understood correctly) it should invite a class, so you can responsive in this class located methods (procs/functions).
Please help me. What should happen next?
Thank you in advance.
Thank you for answering.
My intention is a Server/Client solution, where the Server is on another remote machine than the Client. IMHO the System.Data.SQLite does not support this. Or am I totaly wrong with the mentioned dll?
This sounds a bit weird. If the server is on another machine, the client should "protect" you from the fact that you're dealing with a database.
If you want to use Sqlite (and connect to such a db) on a remote machine, I have never tried such a scenario, but seems to defeat the purpose of sqlite. In other words, the whole purpose of sqlite is to keep everything into a file which it can access really fast at any time. If that file is remote, that guarantee is gone.
-- Log Wizard - a Log Viewer that is easy and fun to use!