Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to check validation group ?
i have a form in which 50 textbox whin i click button then this page validate false how to check which textbox is blank in validation group.

Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Imports .DBUtility
Imports System.Collections.Generic


Public Function getColorCode(ByVal obj As CColorName, ByVal startIndex As Int16, _
                            ByVal endIndex As Int16, ByRef totalRecords As Int16, ByVal TRecords As Boolean, ByVal strCheckColorList As String)As List(Of CColorName)
        Dim objlst As New List(Of CColorName)()
        Dim reader As SqlDataReader
        Try
            If TRecords = True Then
                Dim param As SqlParameter() = New SqlParameter() {New SqlParameter("@ColorID", obj.ColorID), _                                                                                                                                   
                                                                  New SqlParameter("@Color", strCheckColorList) }
                                                           
                reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringRage_RMS, Data.CommandType.StoredProcedure, "dbo.vs_Color_SELECT_TR", param)
                If (reader.Read) Then
                    totalRecords = reader(0)
                End If
                Dim sqlParams As SqlParameter() = New SqlParameter() {New SqlParameter("@ColorId", obj.ColorId), _                                                                      
                                                                      New SqlParameter("@Color", strCheckColorList), _                                                                   
                                                                      New SqlParameter("@startIndex", startIndex), _
                                                                      New SqlParameter("@endIndex", IIf(endIndex = 0, Integer.MaxValue, endIndex))}
                reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringRage_RMS, Data.CommandType.StoredProcedure, "dbo.vs_Color_SELECT_PAGING", sqlParams)
            Else
                Dim sqlParam As SqlParameter() = New SqlParameter() {New SqlParameter("@ColorID", obj.ColorId), _                                                                  
                                                                      New SqlParameter("@Color", strCheckColorList)}
                reader = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringRage_RMS, Data.CommandType.StoredProcedure, "dbo.vs_Color_SELECT", sqlParam)
            End If
            While reader.Read
                Dim objC As New CColorName
                If Not IsDBNull(reader("CModelID")) Then objC.ModelID = reader("CModelID")
              objlst.Add(objC)
            End While
            Return objlst
        Catch ex As Exception
            Logs.WriteErrorLog("DBColor.vb | getColorCode " + ex.Message)
            Return objlst
        Finally
            objlst = Nothing
            reader = Nothing
        End Try

    End Function
Posted
Updated 1-Oct-12 1:28am
v2

The validation groups help you to group the controls in a single page. Following examples will help you implement that:
http://msdn.microsoft.com/en-us/library/ms227424(v=vs.100).aspx[^]
http://www.dotnet-guide.com/validationgroups.html[^]
 
Share this answer
 
Hello Dinesh,

You can use below snipet to validate which validation is pfailed

this.Validators.Where(v => !v.IsValid


Please let us know if any.
 
Share this answer
 
set should set validationGroup Property same for all textbox and button .
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900