Results 1 to 3 of 3

Thread: please help! - find rows and check, URGENT!! :(

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    128

    Thumbs down please help! - find rows and check, URGENT!! :(

    i have four text boxes, a user enters four three figure numbers into these boxes, i then conbine them into on value, adding .'s between each value:

    tx1 tx2 tx3 tx4
    | | | |
    txtAll = 194.003.003.003

    i want to look into the dataset and read the table held on the sql server, then check to see if the field "IPAddress" in any row matches the "txtAll" and if there is display a message otherwise input the data into the table.

    my code is:

    Code:
    Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
      txtAll.Value = (tx1.Value & "." & tx2.Value & "." & tx3.Value & "." & tx4.Value)
      Dim SQLchkIP As String = "(IPAddress = '" & textAll.Value & "')"
      Dim fndRows As DataRow() = dstSSDNetworkHardwareList.Tables("tblNetworkHardware").Select(SQLchkIP)
      If fndRows.Length <= 0 Then
        lblMessage.Text = "OK!"
      Else
        lblMessage.Text = "Already in use!"
      End If
    End Sub
    at the moment there are 5 rows in the table, but even if i use the line:

    [CODE[Dim fndRows As DataRow() = dstSSDNetworkHardwareList.Tables("tblNetworkHardware").Select[/CODE]
    i.e select all, it still return the value of 0 into fndRows..!!!!

    please help.
    Tom
    Last edited by tmashley; Oct 24th, 2002 at 09:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width