Link to home
Start Free TrialLog in
Avatar of gerrystrat
gerrystrat

asked on

Find a Row that is not the primary key

(I'm using .NET compact framework 1.0 and VB.NET)

I have a datagrid that is bound to a datatable object called dtSR.  I want to find a row in a datatable that is not the primary key and put the datagrid on that row.

I have tried the select method of the datatable, which works:

Dim drFind() As DataRow = dtSR.Select("strStructureNo = '" & Me.txtFind.Text & "'")

But, I need to move my datatable, dtSR and my datagrid to this row.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of b1xml2
b1xml2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gerrystrat
gerrystrat

ASKER

Thanks,  I ended up doing it this way so as not to lose the other rows in the datagrid.  

    Dim drFind() As DataRow = dtSR.Select("strStructureNo = '" & Me.txtFind.Text & "'")
    Dim iLocal As Integer = dvSR.Find(drFind(0).Item("intSequence"))
    If iLocal >= 0 Then
        Me.dgdLookup.CurrentRowIndex = iLocal
    Else...


I think I'm getting use to dot net...