how to get the data from database RRS feed


  • Hi abi.bakr,

    Please refer to the following sample code:

    Public Sub ReadData(ByVal connectionString As String)
      Dim queryString As String = "SELECT EmpNo, EName FROM Emp where EmpNo = 1"
      Using connection As New OracleConnection(connectionString)
        Dim command As New OracleCommand(queryString, connection)
        Using reader As OracleDataReader = command.ExecuteReader()
          ' Always call Read before accessing data.
          While reader.Read()
            TextBox1.Text = reader.GetInt32(0).ToString()
            TextBox2.Text = reader.GetString(1)
          End While
        End Using
      End Using
    End Sub

    You can also refer to the following link to get more information.

    Best regards,
    Alex Liang

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, May 27, 2010 7:47 AM