473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

question about binding navigator

hello, I have notice that when i drag a table/column from my dataset onto my form, VS2008 automatically populates the form with a binding navigator and some other stuff like the tableadapters and bindingsources.

I was just wondering about the codes that the bindingnavigator uses to add or move to next or first or last etc... i tried viewing the code of the binding navigator itself, but the only code that is written is the code that commits the changes to the database.

can anyone tell me where i can find an example of the binding navigator codes? cuz i want to create a button that does the same thing as the binding navigator (Specifically the addnew(+) part of the binding navigator).

thanks to anyone willing to help ^_^
Nov 9 '08 #1
1 2737
Ok.... I have just figured out that the code used for the function I need is class.bindingsource.addnew(), took me awhile to figure that out lolz. but now I have a another problem I hope you guys can help me with. I keep getting an error message which has something to do with a foreign key constraint in the child table.



this error pops up when I click the savebutton, this is the code in the button click event

Expand|Select|Wrap|Line Numbers
  1. Try
  2.             Me.Validate()
  3.             Me.PurchaseOrderBindingSource.EndEdit()
  4.             Me.PurchaseOrderTableAdapter.Update(Me.PurchaseOrderDataSet)
  5.             PurchaseOrderDetalPONumberTxt.Text = PurchaseOrderNumberTxt.Text
  6.  
  7.         Catch ex As Exception
  8.             MessageBox.Show(ex.ToString)
  9.         End Try
  10.         Try
  11.             Me.PurchaseOrderDetailBindingSource.EndEdit()
  12.             Me.PurchaseOrderDetailTableAdapter.Update(Me.PurchaseOrderDataSet)
  13.             MessageBox.Show("Saved")
  14.         Catch ex As Exception
  15.             MessageBox.Show(ex.ToString)
  16.         End Try
any ideas why this is happening? I think it has something to do with the table setup in my data base. here is what the tables in my dataset are like

PurchaseOrder(Parent)
-PurchaseOrderID -PK
-Other Information

PurchaseOrderDetail(Child)
-PurchaseOrderDetailID - PK
-PurchasOrderID - FK relation to PurchaseOrderTable.PurchaseOrderID.PK
-Other Information

there are 2 other tables but i doubt that there are any problems in them.As you can see Im Trying to Update two tables at the same time and whenever i click the savebutton only the Purchase Order table saves and i can only save the Purchaseorderdetails table after the purchase Order is saved... please help me ^_^
Nov 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike | last post by:
I wasn't real sure which was the best group for this post - please feel free to redirect to the appropriate group(s). My form uses a binding navigator to move through my data source (imagine...
1
by: ankz | last post by:
Hi Guys I have got 3 tables - in Access Database with Student ID as primary Key in all and all tables are linked with 1 to 1 relationship. I have code the everying with manual program to...
1
by: =?Utf-8?B?Sm9iIExvdA==?= | last post by:
how can i add a check box to binding navigator control? thanks
0
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I am dragging a data souce (access.mdb) to a form. C# automaticallt creates the table adapter, binding adapter, etc. But for some reason, it is not automatically creating the binding navigator. Any...
3
by: Rick | last post by:
VS 2005 The short version: How can I set the enabled state of a button depending on if a strongly-typed datatable has a DeleteCommand? *************************** The long version:
2
by: Randy | last post by:
Hi, I'm trying to figure out some binding navigator code. If I have the primary field value as selected by the user in a combo box, how can I instruct the binding navigator to move to that...
0
by: ashishchatterjee | last post by:
how can we move the data in the field using binding navigator tool so please send methe code for the following. OS: windows xp sp2 Languge:visual studio2005
0
by: Gianni B | last post by:
Hi Dudes Have anyone tried to write a control in WPF like the binding navigator (Windows Forms) or is there a similar control to navigate between records?? Thank you
1
by: dorkboy | last post by:
Hi all, I am a newbie using VB.net in VS 2008. I took over a vb.net winform application that has a binding navigator in it. The users wanted to add 2 new fields to the form. I added the new...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.