Results 1 to 7 of 7

Thread: darn it , no action at all [UN -Resolved yet]

Threaded View

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    darn it , no action at all [UN -Resolved yet]

    Hell , I dunno what the **** is going wrong with this code , no action at all .I hate it .Basically , I want to search my database.anyone has example or a link ....thanx for any help .
    VB Code:
    1. Private Sub Button2_Click(ByVal sender As System.Object _
    2. , ByVal e As System.EventArgs) Handles Button2.Click
    3.  
    4.         Dim MyConnection1 As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &  _
    5. MyPath & ";Jet OLEDB:Database Password=" & MyPassword)
    6.         Dim myDataReader As OleDbDataReader
    7.         Dim txt As String = "SELECT * FROM MyTab WHERE C_URL LIKE '" & TextBox7.Text.Replace("'", "''") & "*'"
    8.         Dim myOleDbCommand = New OleDbCommand(txt, MyConnection1)
    9.  
    10.         MyConnection1.Open()
    11.         myDataReader = myOleDbCommand.ExecuteReader()
    12.         Do While (myDataReader.Read)
    13.  
    14.             If (myDataReader.IsDBNull(0)) Then
    15.                 MsgBox(myDataReader.GetString(1))
    16.                 Console.Write("N/A" + Chr(10))
    17.                 MsgBox("no data")
    18.             Else
    19.                 Console.Write(myDataReader.GetInt32(4).ToString() + Chr(10))
    20.                 MsgBox(myDataReader.GetInt32(4).ToString() + Chr(10))
    21.             End If
    22.         Loop
    23.         myDataReader.Close()
    24.         MyConnection1.Close()
    25.  
    26.     End Sub
    Last edited by Pirate; Feb 7th, 2003 at 11:31 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