Wednesday, April 13, 2011

pass datbase value to textbox(vb.net 2008)

Private Sub int_pen_serv_rate()
        connection_open()
        Try
            ssql = "SELECT * FROM tblsetting "
            cmd = New OleDbCommand(ssql, olecon)
            objRead = cmd.ExecuteReader
            While objRead.Read
                txtinterest.Text = objRead("interest_r")
                txtpenalty.Text = objRead("penalty_r")
                txtservice.Text = objRead("s_fee")
            End While
            objRead.Close()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            connection_close()
        End Try
    End Sub

No comments:

Post a Comment