Have you tried tracing this through the debugger?
>Yes, the code snippet is :
>
> Private Sub View_BatchDetail_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
>
> ' this routine executes the sql stmt
> ' and displays the data in the grid
>
>.
>.
>.
>code here to find and fill the dataset
>.
>.
> If dsResults.Tables("BatchDetail").Rows.Count > 0 Then
> ' bind the data grid to the dataset
> dgdResults.DataSource = dsResults
>
> ' expand the grid and show the data immediately
> dgdResults.Expand(-1)
>
> ' go to the first record
> dgdResults.NavigateTo(0, "BatchDetail")
> Else
> ' the MsgBox always displays if there are no matching records
> MsgBox("There are no records matching your search criteria.")
> Me.Close()
> End If
> Catch
> UnhandledExceptionHandler()
> End Try
>
> End Sub
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi