HTML beginner |
|
Beste,
Ik maak een ASP.NET 2 applicatie en wil heb mijn connectiestring (om db te connecten) in mijn web.config geplaatst. Ik kan die via configurationManager oproepen maar wil die graag in mijn control gebruiken. Hoe zou ik dit kunnen doen ?
Dim strConnectie As String = ConfigurationManager.ConnectionStrings("Database").ConnectionString
<asp:SqlDataSource ID="SqlDataSourceNieuws" runat="server"
ConnectionString="hierzo"
ProviderName="System.Data.OleDb"
SelectCommand="SELECT * FROM tblNieuws"
UpdateCommand="UPDATE tblNieuws SET titel = @titel, bericht = @bericht, datum = @datum, auteur = @auteur WHERE id = @id"
DeleteCommand="DELETE FROM tblNieuws WHERE id = @id" >
</asp:SqlDataSource>
Dim strConnectie As String = ConfigurationManager.ConnectionStrings("Database").ConnectionString <asp:SqlDataSource ID="SqlDataSourceNieuws" runat="server" ConnectionString="hierzo" ProviderName="System.Data.OleDb" SelectCommand="SELECT * FROM tblNieuws" UpdateCommand="UPDATE tblNieuws SET titel = @titel, bericht = @bericht, datum = @datum, auteur = @auteur WHERE id = @id" DeleteCommand="DELETE FROM tblNieuws WHERE id = @id" > </asp:SqlDataSource>
|