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...
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