Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check the dataset databindings duplicate key or null
Message
De
20/05/2011 05:44:21
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
How to check the dataset databindings duplicate key or null
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01511207
Message ID:
01511207
Vues:
67
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 but no information...... thank thank thank
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform