I'm carrying out a school project in C# applications and that i made the decision to produce a ticketing system. I wish to impress my teacher (^^) and so i made the decision to include a database for my application. I've got a month to get this done and so i think I'm able to learn it since i have haven't any prior knowledge about databases.
Would you let me know how to get it done? Below is my application, I wish to send the data within the
TextBox to some database
I already adopted the instructions in MSDN which essentially informs you the way to include an information source inside your application. I added northwind dataset to my application, but I'm not sure what related to it and just how could it be helpful with my application...
That's quite a broad question, can there be something particularly that you'll require assist with? Like connect with the database, make use of a datareader, etc...?
If you wish to impress your teacher, don't make reference to MSDN. Use something similar to couchdb. Do not get swept up within the "recommended " .internet ecosystem.
For any SQL after sales, you should use SQLite very easily. SQLite is only a file that resides around the local system, so it's totally portable/deployable together with your application. It arrives with the caveat the database isn't shared between customers. It's a single user database. A couple running a credit card applicatoin according to SQLite won't work together. For any uni assignment, this really is most likely not really a large deal.
You might use SQL Server CE (compact edition), the industry removed lower SQL Server implementation which is comparable to SQLite (local, embedded, single user). This will help you to use Visual Studio database tools to create your database.
After you have a database embedded in your application, you have to design a schema to carry onto these details. In case your screenshot may be the only data you have to save, a table such as the following should have the desired effect:
TABLE PERSON COLUMN name varchar(100) COLUMN address varchar(200) COLUMN email varchar(100) COLUMN mobile varchar(15)
You will have to investigate how you can create tables in SQL. Which should show you in the thing you need though. Visual Studio (some versions), in addition have a database browser/designer.
You will want to determine how you need to talk to the database. There are several options.
- Linq 2 SQL
Scott Gu comes with an excellent series regarding how to use Linq 2 SQL that we would recommend reading through. It'll go a lot of the method to helping you're able to in which you need.
So now that you've got a SQL database along with a provider, you can begin attempting to wire in the database towards the form. This is when databinding is available in. You are able to drag an information Source onto an application (that is your Person table), and wire in the table for your text fields. You will find many good examples around the internet how to get this done.
If you wish to go one step further, consider the ErrorProvider control. It will help you to bind validation for your databases and text fields. Once more, a couple of google searches should point you within the right direction.
I've not provided code samples since this is homework. If you wish to impress your teacher, you is going to do so by truly comprehending the technology you are attempting to use. These are merely pointers within the right direction so guess what happens you can investigate. All the best.