Programming & Webscripting FAQ: .NET
FAQ
- ASP.NET Webdev tips (!)
- Waar zet ik het beste een connectionstring?
- Mijn sessievariabelen gaan verloren?
- User ASP.NET heeft geen toegang tot de database
Problemen bij connecten met je database
- Hoe gebruik ik waarden uit het ene form in het andere?
Waar zet ik het beste een connectionstring?
De connectie-string zet je het best in je web.config. (Dit is ook te lezen in de best practices van Microsoft vermoed ik).
In de web.config kan je een sectie 'appSettings' bijmaken:
1
2
3
4
5
| <appSettings> <add key="connstring" value="hier komt de connectie-string" /> </appSettings> |
Die connectiestring kan je dan makkelijk in uw code ophalen door gebruik te maken van het ConfigurationSettings object:
1
2
3
| using System.Configuration; .... string connstr = ConfigurationSettings.AppSettings["connstr"]; |
Over het hebben van 1 connectie die je overal kunt gebruiken:
Aangezien je gebruik kunt maken van connection pooling, is het beter om iedere keer een nieuw connectie-object te maken wanneer je het nodig hebt, en van zodra je geen database-connectie meer nodig hebt, die connectie te sluiten.
Zie ook:
- Connection pooling for SQL Server data provider (ADO.NET)
- Uit dit artikel:
ADO.NET Connection
You use the ADO.NET Connection object to create a connection between your program and a database engine. You will normally keep this connection open just long enough to retrieve or update data. By quickly opening, then closing a connection, you use server resources for as little time as possible. This helps you develop scalable, fast applications that are resource-friendly. The fewer resources you use, the more users you can support on your applications at one time.
Links
- http://www.icsharpcode.net/OpenSource/SD/
SharpDevelop (C# IDE)
- http://www.asp.net/webmatrix/default.aspx?tabindex=4&tabid=46
Matrix (ASP.NET IDE)
- http://www.gotdotnet.com/team/csharp/
C# team site met tools en articles
- http://www.codeproject.com
Codeproject met erg veel sourcecode
- http://www.asp.net/Tutorials/quickstart.aspx
ASP.NET quickstarts
- http://www.regexlib.com/Default.aspx
Regular Expression library for .NET
- http://www.dotnetmagic.com
Magic .NET gui library (free, open source)
- http://quickcode.dvxp.com/
QuickCode .NET, handige plugin voor VS.NET voor template based codesnippet inserts
- http://www.syncfusion.com/FAQ/WinForms/default.asp
Windows forms FAQ
- http://www.c-sharpcorner.com/
- http://www.execpc.com/~gopalan/dotnet/net_tutorial.html
- http://www.gotdotnet.com
- http://www.dotnet.be
- http://www.dotnetjunkies.com
Boeken
ADO.NET
- ADO.NET Programming
Door: Arlen Feldman
ISBN: 1930110294
Manning Publications
ASP.NET
- ASP.NET Unleashed
Door: Stephen Walther
ISBN: 0672320681
Sams publishing - ASP.NET Website Programming: Problem - Design - Solution C# Edition
Door: Marco Bellinaso, Kevin Hoffman
ISBN: 1861006934
Wrox Press - Professional ASP.NET
Door: Alex Homer, Brian Francis, David Sussman, Karli Watson, Richard Anderson, Rob Howard
ISBN: 1861004885
Wrox press
C#
- Professional C#, Second Edition
Door: Simon Robinson, K. Scott Allen, Ollie Cornes, Jay Glynn, Zach Greenvoss, Burton Harvey, Christian Nagel, Morgan Skinner, Karli Watson
ISBN: 0764543989
Wrox Press - C# and the .NET Platform
Door: Andrew Troelsen
ISBN: 1893115593
APress - Learning C# (2nd edition)
Door: Jesse Liberty
ISBN: 0596003765
O'Reilly & Associates inc.
[ Voor 157% gewijzigd door NMe op 13-05-2005 17:40 ]
Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz