Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check the dataset databindings duplicate key or null
Message
From
20/05/2011 23:41:57
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
How to check the dataset databindings duplicate key or null
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01511342
Message ID:
01511342
Views:
68
Hi all,
i have some difficult questions. i have a dataset( set a primary , b not null ) use databindings and one add, delete, save, exit buttion.
Remark i use
 Private Sub Company_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

        Me.Validate()
        Me.CompanyBindingSource.EndEdit()

        If ADataSet.HasChanges(DataRowState.Added Or DataRowState.Deleted Or DataRowState.Modified) Then
            Dim drResult = New DialogResult()

            drResult = MessageBox.Show("Data updated, Do you want to save before program exit?", "Exit program", MessageBoxButtons.YesNoCancel)

            Select Case drResult
                Case DialogResult.Yes
                    CompanyBindingNavigatorSaveItem_Click(sender, e)
                    DataGridView1.Dispose()
                    e.Cancel = True
                Case DialogResult.Cancel
                    e.Cancel = True
                Case DialogResult.No
                    e.Cancel = False
                    DataGridView1.Dispose()
            End Select
        End If

    End Sub
1. How can i check the user entry duplicate primary key , pop msg?
2. If the user entry true primary key, but no entry b field, after he use BindingNavigator go to other position, how to check the b field not null
3. How to check user press exit , then closing the form ,if primary key duplicate also colsing, no check him ?
4. i have a datagirdview, the user entry the primary key but b field no entry , how to check him after he press save or add button ,
and focus to null cell .

Anyone can give some idea , i already find some days in internet and more book but no information...... thank thank thank
Reply
Map
View

Click here to load this message in the networking platform