Looping through select statement results in MSSQL Windows 7 GodMode
Mar 12

Read CSV Into an ADO.NET RecordSet

http://www.daniweb.com/forums/thread38676.html#

DateTime Examples C#

http://www.geekpedia.com/tutorial98_Using-the-DateTime-object.html

C# Dictionary

http://www.vcskicks.com/dictionary.php

Dictionary<string, int> dictionary = new Dictionary<string, int>();

dictionary.Add(“1″, 1);

int j = dictionary["1"];

C# List Examples

http://dotnetperls.com/list

List<int> list = new List<int>();
list.Add(2);
list.Add(3);

Decimal.TryParse and Convert.ToDecimal
http://stackoverflow.com/questions/89203/difference-between-convert-todecimalstring-decimal-parsestring

One factor that you might not have thought of is the Decimal.TryParse method. Both Convert.ToDecimal and Parse throw exceptions if they cannot convert the string to the proper decimal format. The TryParse method gives you a nice pattern for input validation.

decimal result;

if (decimal.TryParse(”5.0″, out result))

; // you have a valid decimal to do as you please, no exception.

else

; // uh-oh. error message time!

This pattern is very incredibly awesome for error-checking user input.

String List string[] to an ArrayList in C#
http://www.daniweb.com/forums/thread82407.html#


string str= "12,13,14,15";
  1. string[] strs = str.Split(',');
  2. ArrayList strsList = new ArrayList();
  3. foreach(string s in strs)
  4. strsList.Add(s);
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google

One Response to “C# Nuggets March 12th 2010”

  1. Kylie Batt Says:

    Я извиняюсь, но, по-моему, Вы не правы. Могу это доказать….

    ToDecimal
    http://stackoverflow…..

Leave a Reply

Spam Protection by WP-SpamFree