473,395 Members | 1,653 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,395 software developers and data experts.

Generating PK by using one bindingnavigator control

13
Hi,

I’m using VS2005 and the bindingnavigator control. Right now I’m using 2 bindingnavigator control (each for one table) in order to generate the new ID when I clicked the ‘add new” button. But I want to know what command and line of C# I must add to my program to generate the new ID when I clicked the “add new” button IF I want to have 1 bindingnavigator control for both of them.

Thank you
Mar 23 '07 #1
2 1405
what DBMS are you using? Does the application need to know about how to create the PK value? In Oracle I use a Sequence to do it with a trigger. In sql you can use a identity column, or a unique identifier, or a trigger to assign it in an instead of insert case. My apps never assign primary keys, and this is the manner with which I manage them, depending on the database.

Jon
Mar 24 '07 #2
csharpa
13
Hi I'm using MSSQL. I set the auto generator for PK in the database. can u explain more?
thank you
Mar 24 '07 #3

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

Similar topics

0
by: WeBe | last post by:
Hi! How do you trap the navigation events (MoveNext, MoveFirst, etc.) in a BindingNavigator before the navigation has been done? There must be a way to check the state of the current item and...
5
by: John | last post by:
Hi When I press the delete button on the BindingNavigator it deletes the record without any warning. How can I add a warning dialog when the delete button on the BindingNavigator is pressed and...
0
by: Chuck Gantz | last post by:
I have a child table (the "TestType" that is in my code below) that I am trying to bind to its parent ("Test" in the code. I've commented out that line below sice it doesn't fix my problem). The...
0
by: Firoz | last post by:
Good day all, On my base form I have amongst others, a BindingNavigator/Datagridview control. I have changed the modifier properties for all the controls to "Protected Friend", but for the...
0
by: Chris Holland (Dutchy007) | last post by:
Hi All, Just wondering if anyone knows weather or not i can use a bindingnavigator on a PPc 2003 application. The control is grayed out in the toolbox in the devenv. I have referenced it so it...
2
by: Dave | last post by:
I have a c# program that uses the bindingnavigator control. It works fine, but I want to add the ability for a user to change his mind after clicking 'delete' to delete a record. So if the user...
3
by: michael sorens | last post by:
I have generated an XmlDocument, then bound it to a DataGridView (thanks to a pointer from PeterBromberg in a separate, recent posting). Now I want to connect a BindingNavigator, but my rudimentary...
0
by: peterlewis | last post by:
Hi, I am unable to delete the current record from bindingnavigator - has a null bindingSource.Current although I can insert new records. The bindingnavigator was added as a control and the data...
0
by: Rick | last post by:
VS 2005 I have some custom business objects (BindingList(of T)) connected through BindingSources to a BindingNavigator. When the user moves focus the BindingSource of the navigator can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.