6 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Lusiphur

As it seems to come up often enough I figured I'd throw together a quick snippet outlining basic methods for data manipulation in SQL Server using C#. In all examples the coder will need to substitute their own connection string details and variables. I utilised parameters for 3 of the …

Member Avatar for sarvesh_3
2
21K
Member Avatar for Reverend Jim

Several people have asked about storing binary data in a database. I coded up an example today that uses an ADODB.Stream to copy the binary data but after some fiddling I found a more direct way. If you are using MS SQL Server, the easiest way I have found is …

0
2K
Member Avatar for Reverend Jim

A lot of questions in the VB.NET forum are database related. Most of the code that gets posted result in one or more comments like "use parameterized queries to avoid SQL injection attacks". I won't describe the nature of a SQL injection because it is easily looked up via google. …

Member Avatar for Reverend Jim
6
5K
Member Avatar for metalix

View the full tutorial at [URL="http://www.effectivewebdesign.co.nz/tutorial.php"]http://www.effectivewebdesign.co.nz/tutorial.php[/URL] I have tested this many times and it works fine. Please don't complain unless you really can't get it working, Just PM me and I'll fill in the blanks Happy Coding :)

Member Avatar for Rogueit
0
841
Member Avatar for metalix

To view this tutorial with notes at [URL="http://www.effectivewebdesign.co.nz/tutorial.php"]http://www.effectivewebdesign.co.nz/tutorial.php[/URL] yes I am aware this is more php than mysql. howerver I get asked how to do it so often I thought I'd post it here aswell :)

0
689
Member Avatar for sid78669

This code demonstrates how age might be calculated and filtered using the DateDiff method in SQL. Also, note that both the parameters are set to NULL by default, hence making them 'optional' to a certain limit.

0
460

The End.