New in .Net VB but learning datareader, access DB
Hi.
I want to now a little about CodeBehind how to use it with SqlConnection, SqlCommand and SqlDataReader.
How i use:
Web.Config
<connectionStrings>
<add name="ConnectionStringTest" connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=|DataDirectory|\DSNbase.mdb;Persist Security Info=True" providerName="System.Data.OleDb"/>
</connectionStrings>
Default.aspx
<asp:Repeater ID="test" runat="server" DataSourceID="SqlDataSourcetest">
...
..
<asp:SqlDataSource ID="SqlDataSourcetest" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionStringTest %>"
ProviderName="<%$ ConnectionStrings:ConnectionStringTest.ProviderNam e %>"
SelectCommand="SELECT [ID], [Name], [************], [Born], [Color], [Dog], [Images] FROM [Dogs] WHERE ([Dog] = 'YES') ORDER BY [ID]">
</asp:SqlDataSource>
How can i take my asp:SqlDataSource and put it in my CodeBehind, so it use the ConnectionString from my Web.Config and so i can use my Repeater on my default.aspx site.. !?
Maybe if u got a great link that show "How to do" maybe om MSDN/MSDN2.
|