Results 1 to 2 of 2

Thread: Best way to connect to one database with different forms.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2012
    Posts
    75

    Best way to connect to one database with different forms.

    Hi!

    I am struggling with this question: How should I set up a database in my project when I want to connect it to multiple forms.

    Do I have to set up a new dataadapter, dataset, OleDBconnection, OleDBcommand on every form?

    On my main form I used the wizard that binds all the fields to my database. It has the following: tableadapter, tableadaptermanager, dataset and bindingsource

    *If I want to do a form for editing how should I set that up.
    *How to set up a form that creates new row to database.

    *And Could somebody give different examples how to delete a row directly from database.

    I am using this right now
    Me.Validate()
    Me.BindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.DataSet)
    MsgBox("Record deleted successfully!", MsgBoxStyle.Information, "Title_of_My_form")


    I'd appreciate giving me some tips and pointers...

  2. #2
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    Re: Best way to connect to one database with different forms.

    Hi,

    Have a read through this tutorial as a starting point for working with Databases in your project:-

    http://www.homeandlearn.co.uk/net/nets12p1.html

    Hope that helps.

    Cheers,

    Ian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width