Imports System.Data
Imports System.Data.OracleClient
Imports System.Web.Configuration
Partial Class test1
Inherits System.Web.UI.Page
Dim Conn As OracleConnection
Dim Cmd As OracleCommand
Dim sqlx As String
Dim dtReader As OracleDataReader
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim strconnstring As String
strconnstring = "Data Source=xxxx;User Id=xxxx;Password=xxxx;"
Conn = New OracleConnection(strconnstring)
Conn.Open()
sqlx = "SELECT * FROM SCHOL_NEWS WHERE N_STATUS = '1' ORDER BY N_ID DESC"
Cmd = New OracleCommand(sqlx, Conn)
dtReader = Cmd.ExecuteReader()
If dtReader.Read() Then
Repeater1.DataSource = dtReader
Repeater1.DataBind()
End If
End Sub
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
Conn.Close()
Conn = Nothing
End Sub
End Class