April, 2006

  • Formatting Strings in a DataGrid

    In my opinion, one of the coolest .net controls is the DataGrid.  There is sooo much you can do with this puppy.  One of the things I like most about it is how you can choose to control or not control how data is rendered.  Which brings...
  • Determine how many records are in a DataSet

    To determine how many records are in a dataset, you can use the Count method of the Rows in a table (last line in code).         // New DataSet         DataSet dbSet = new DataSet ...
  • Date and Time in a SQL Statement (DateTime)

    To get the date and time for a datetime value in SQL Server, use the GetDate method.  It will return the current system date and time in the SQL Server standard internal format for datetime values. This is a pretty useful function if you need to...
  • Close Registry Keys After Use

    To open a windows registry key using C#, the code would look something like this: RegistryKey rk = Microsoft.Win32. Registry .LocalMachine.OpenSubKey( "Software\\TWC\\Applications" , true ); The RegistryKey object has lots of methods on it to...