PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Need help with relations-VBForums
Results 1 to 5 of 5

Thread: [RESOLVED] Need help with relations

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    Resolved [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:
    1. Dim connection As SQLiteConnection = New SQLiteConnection("Data Source=personel.sqlite; Version=3; FailIfMissing=true; Foreign Keys=true;")
    2. Dim dataAdapter As SQLiteDataAdapter
    3. Dim command As SQLiteCommand
    4. Dim dataTable As DataTable
    5. Dim bindingSourceBp As BindingSource
    6. Dim bindingSourceJob As BindingSource
    7. 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

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    104,723

    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    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.

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    104,723

    Re: Need help with relations

    Quote Originally Posted by nikel View Post
    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.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2013
    Posts
    200

    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
  •  



Featured


Click Here to Expand Forum to Full Width