hi! i am using access as my database, what i want to know is how to add, edit and do a simple query in c#
i am a new to c# just want to learn a little work around. just a sample will do.
thanks alot!
Printable View
hi! i am using access as my database, what i want to know is how to add, edit and do a simple query in c#
i am a new to c# just want to learn a little work around. just a sample will do.
thanks alot!
If you want to learn that stuff I would recommend using the Data Form Wizard. Right-click your project in the Solution Explorer and select Add New Item. From the template list select Data Form Wizard. The wizard will then ask you a series of questions and, based on your answers, create a form that contains all the objects you need retrieve, display and update data. You can then play around and explore the code 'til your heart's content. Note that the Provider for a connection to an Access database is Microsoft Jet 4.0 OLE DB Provider. You'll see when it is needed. Also, you'll need at least a basic understanding of SQL, which I'm guessing you have already.
c# and vb.net are just the same when it comes in inserting records to the database.
if you know vb.net saving records to the database then you have no worries when it comes to c#.
and oh i always get rid of wizard coz i dont know what its doing. I love to hardcode it so that i know what's going on.
but i don't know in vb.net either, you coul please provide me an example. just a simple one will do. thanks
I never use the Data Form Wizard myself, but if an example of how to use a database in a .NET app is required, isn't that exactly what the wizard would provide?Quote:
Originally Posted by mar_zim
we can't deny that using wizard is so easy because it will do all your work just provide some connection to it. But the sad part is that you don't know what was going on or what technique it uses. Many of the newbie's uses data wizard that they don't know what's going on. Me too im a newbie in databases but i never used data wizard. If you want to start programming in databases much better if you hardcode it. They're lots of things you learn when you hardcode it.
Unless you're very good in databases then use wizard coz you already know what's going on.
And yeah data wizard are used to communicate your app's to the database.
and oh kulitag if have a time tomorrow then i will post some samples regarding your problem.
anyone please! need it badly!
bump!
Have you tried the Data Form Wizard? If not, is there a particular reason? It will create the same code that an example from someone else will provide anyway.
The best way is to use stored procedures if you are using SQL server or Oracle. If not then use an sql string.
This should help.Quote:
Originally Posted by kulitag