|
-
Oct 14th, 2007, 08:33 AM
#1
Thread Starter
Member
[2005] problem with database ( the binding navigator )
hi i am a newbie in vb 2005
and now i am learning how to connect access database using access
and i learn using th book, so i create data source, and set to my database file after that all the step finish and i can select the view , so i use datagrid view and drag it into my form and the problem appears, it show on the book that when you drag the datagrid there are also create automatically all object that support it in my case , there is no binding navigator which is i can not save a new record, i tried to insert it but after i close the program and run the program again , the new record gone . how to display the binding navigator
thanks a lot
Arif
-
Oct 14th, 2007, 07:18 PM
#2
Re: [2005] problem with database ( the binding navigator )
Dragging a DataGridView onto your form does nothing more than creating a DataGridView. What you're thinking of is dragging a table from your Data Source onto the form. THAT will create a DataGridView, a BindingSource and a BindingNavigator. There's no reason that you can't add those three components yourself and bind them together. The BindingSource is assigned to the grid's DataSource property and the navigator's BindingSource property.
As for your data not being saved, that is not the case. Your data IS being saved. It's just that you're overwriting it every time you run the project in the debugger. Select your database in the Solution Explorer and open the properties window, then set its Copy To Output Directory property to Copy If Newer. Now it will only be overwritten when you make changes to the original.
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
|