C
Casper
Hi,
i know how to use datareader in code-behind, e.g. like this:
Dim oConnection As OleDbConnection
Dim comd As OleDbCommand
Dim dtreader As OleDbDataReader
oConnection = New OleDbConnection()
oConnection.ConnectionString = Application("connect")
oConnection.Open()
sql = "SELECT * from table"
comd = New OleDbCommand(sql, oConnection)
dtreader = comd.ExecuteReader
...
This works perfect, but how to use dtreader when the datasource is defined
in the aspx file like this?
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:cat %>"
SelectCommand="SELECT * table"></asp:SqlDataSource>
I tried this in code-behind:
Dim dtreader As OleDbDataReader
dtreader=sqldatasource1.??? 'there is no ExecuteReader available in
the list
Thanks for helping.
Casper
i know how to use datareader in code-behind, e.g. like this:
Dim oConnection As OleDbConnection
Dim comd As OleDbCommand
Dim dtreader As OleDbDataReader
oConnection = New OleDbConnection()
oConnection.ConnectionString = Application("connect")
oConnection.Open()
sql = "SELECT * from table"
comd = New OleDbCommand(sql, oConnection)
dtreader = comd.ExecuteReader
...
This works perfect, but how to use dtreader when the datasource is defined
in the aspx file like this?
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:cat %>"
SelectCommand="SELECT * table"></asp:SqlDataSource>
I tried this in code-behind:
Dim dtreader As OleDbDataReader
dtreader=sqldatasource1.??? 'there is no ExecuteReader available in
the list
Thanks for helping.
Casper