Link to home
Start Free TrialLog in
Avatar of ramma
ramma

asked on

rptGuestbook.DataSource = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

Hi experts ...
this code is used to select records from Access db table.
i need to understand the meaning of these two lines :
----------------------------------------------------------------------------------
rptGuestbook.DataSource = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
rptGuestbook.DataBind()
----------------------------------------------------------------------------------
This is the whole code :

<script language="VB" runat="server">
Sub Page_Load (Source As Object, E as EventArgs)
      Dim strConn as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("guestbook.mdb") & ";"
      Dim MySQL as string = "SELECT Name, EMail, URL, Comment FROM Guestbook"
      Dim MyConn as New OleDBConnection (strConn)
      Dim Cmd as New OleDBCommand (MySQL, MyConn)
      MyConn.Open ()
      rptGuestbook.DataSource = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
      rptGuestbook.DataBind()
End Sub

</script>
ASKER CERTIFIED SOLUTION
Avatar of stengelj
stengelj
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial