Andrees92 0 Newbie Poster

Okay, I have used databases before, but I always created the bindingsources and other things i needed via the visual designer, and now I want to create them with code, so I can make a button to refresh the database without closing it, the problem is that I don't know how to connect them (datasets, adapters, bindingsources) to the database, my database is called gLibraryDB.mdf (SQL) and has two tables, Library and Account, so far I thought that I would need to declare the BS, datasets, etc., so what I made is this:

    Dim LibraryBS1 As New BindingSource
    Dim LibraryBS2 As New BindingSource
    Dim LibraryBS3 As New BindingSource
    Dim LibraryBS4 As New BindingSource
    Dim LibraryBS5 As New BindingSource
    Dim AccountBS1 As New BindingSource
    Dim LibraryDS As New DataSet

Is it ok? And after that, do I need to create DataAdapters? How do I connect the DataSet and BindingSources to the database with code?
Thanks in advance!
--Andres.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.