-
Mar 27th, 2017, 11:45 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Need help with relations
Hello, I'm trying to learn relational database to create proper databases. My question is do I need to create dataset and datarelations even if I created them in an SQLite database? Here's the variables I used for instance:
VB.NET Code:
Dim connection As SQLiteConnection = New SQLiteConnection("Data Source=personel.sqlite; Version=3; FailIfMissing=true; Foreign Keys=true;")
Dim dataAdapter As SQLiteDataAdapter
Dim command As SQLiteCommand
Dim dataTable As DataTable
Dim bindingSourceBp As BindingSource
Dim bindingSourceJob As BindingSource
Dim bindingSourceLbx As BindingSource
I mean do I have to learn about dataset or data schema, if so where can I find a good tutorial?
Last edited by nikel; Mar 27th, 2017 at 11:46 PM.
Reason: I changed title
-
Mar 28th, 2017, 12:16 AM
#2
Re: Need help with relations
What you need to do any specific situation depends on that situation but, in general, a DataSet is an in-memory representation of your database and the DataTables and DataRelations it contains are in-memory representations of the corresponding tables and relations in the database. You use a data adapter, which contains four command objects, which each contain a connection object, to connect to a database retrieve data into a DataSet and then save changes back again.
You won't have one DataSet for the whole application so you will only use what you need in any particular situation. If you only need to use data from one table then just use a DataTable on its own. If you need to be able filter parent/child data or insert parent and child records then you need a DataSet with two DataTables and a DataRelation.
For more general information, search for "ado.net" and/or "vb.net data access" and the like. You might start with the relevant links in my signature below. Note that ADO.NET works basically the same way for any data source, so you don't necessarily need information specific to SQLite to learn most of what you need.
-
Mar 28th, 2017, 01:37 AM
#3
Thread Starter
Addicted Member
Re: Need help with relations
I see, I'm working on three tables right now so I must use DataSet. Bad to hear that. Anyway thank you for your reply.
-
Mar 28th, 2017, 02:09 AM
#4
Re: Need help with relations
Originally Posted by nikel
Bad to hear that.
Why? Is it bad to hear that you have to use an array because you want to store more than one value? You use what's appropriate for the situation. It would be worse to hear that you couldn't use one, in which case managing your data would be much more difficult.
-
Mar 31st, 2017, 03:25 PM
#5
Thread Starter
Addicted Member
Re: [RESOLVED] Need help with relations
You're right, but not absolutely. I admit I'm a bit lazy and do a lot of copy/paste. But I have limited programming basics, I haven't join courses or lessons recently (in fact since about 30 years) it's hard for me to learn new things. And you can't blame me that I can't think as if I was a Microsoft developer, but your comment forced me to do that, thanks a lot.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|