Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code Snippets

Status
Not open for further replies.

Tinkerers

Technical User
Sep 26, 2002
90
US
Hi,

I'm looking for some code snippets around connecting to sql server db's. Data Readers, grids and the whole nine yards would be nice. I've poked around the internet and have not been able to find a good collection of code snippets around this.

Somewhere there must exist a good cheat sheet for all the possible sql server db connections and reading from them.

Ideas?

Thanks,
Paul
 

google connecting with datareader, or dataset ect..
I would also say create your own small web app or what ever, wtih each page connecting to your DB and using dataset, datareader ect..

That way you always have your code snippets. :)

Ordinary Programmer
 
google, yahoo, msdn... they have a few references.

however I will say that 99% of these only show you how to connect. they do not provide best practices of how to manage the connection. for that I recommend 2 concepts
1. Unit Of Work (Robert "Uncle Bob" Martin has some input on this concept)
2. [Unit Of Work]/Session/Connection per View: which is specific to web development. This is very common with data access/ORM framworks. if you reseach this exchange the word/concept "Session" with "Connection".

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top