There are many ways you can connect to a database in ASP.NET, the way i’m going to explain here based on “try and error” during my development years. I will try to explain why i do each step and what errors i had in the past so you may prevent these in your web applications. Experienced programmer should know each of these steps and may disagree so discussion is open to debate.
MSSQL
13
Sep 09
HOWTO: Group rows by day in MSSQL
This trick is usually useful in statistic where you need to count or sum records based on record day. Using it will help you grouping rows by day or month depends on your needs.
12
Sep 09
HOWTO: Schedule MSSQL query task
Check the images below to learn how to create a scheduled mssql query task using Microsoft’s Sql Server Management Studio. Red zones are the most important for you to check or to click on and black zones are the ones you not supposed see because screenshots were taken from live server.
11
Sep 09
HOWTO: Loop though each query result or MSSQL for loop
Many times i found myself in trouble ( Beatles ???) when i needed to change sql tables design based on some conditional logic so i couldn’t use Insert Select technique simply because it doesn’t support if statements when i needed something beyond when condition abilities.
10
Sep 09
HOWTO: Redesign sql table using Insert Select technique
My requirement was to totally redesign the table when i couldn’t just perform delete and update tasks on it. In this example i create new table based on old table’s filtered result set.