[General , Tools ] 17 January, 2008 06:46

Looking for a great text editor for a great price.  Check out pspad can't beat the features or speed for the price.

It will syntax color most file types out of the box.  There are other syntax defintions and plugins in the download center. 

[General , Development , C# , .NET ] 17 January, 2008 06:42

 

WatiN will run scripts http://watin.sourceforge.net/ there is also a recorder to make you life a bit easier.  Checkout WatiN Test Recorder http://watintestrecord.sourceforge.net/  

[SharePoint ] 17 January, 2008 06:12

If you get this error you have most likely not assigned and indexer when creating the content Database

Go into :

SharePoint 3.0 Central Administration -> Application Management -> SharePoint Web Application Management -> Content databases -> Content Database used for the site > Set the Search Server

[General ] 27 November, 2007 06:21

 

Link to site: GOOG411

1-800-GOOG-411 

It seems like I have been using 411 a bunch lately and now it will only cost you what a 1-800 call usually does. 

 

 

[Development , PowerShell ] 05 November, 2007 08:21

We got a 111 Gig SQL script and it would not load into anything to be run, so I wrote this poershell script to split it up, I am splitting it up on any line greater than 60000 that has an Insert command.

Just slung some code quick and dirty 

process
{

   # Read Arg0 as the input file     
   $fs = new-object System.IO.FileStream($args[0], [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read)
   $fs.open
   $sr = new-object System.IO.StreamReader($fs)

   # setup the new file name based on Arg1 if Arg1 is myfile.sql, files created will be myfile0.sql, myfile1.sql ...
   $basefilename = $args[1]
   $extension = $args[1]
   $lastindex = $extension.LastIndexOf('.')
   $basefilename = $basefilename.Substring(0, $basefilename.length -($basefilename.length - $lastindex))
   $extension = $extension.Substring($lastindex)
  
   $basefilename
   $extension
  
  
   $currpart = 0
   $currentfilename = $basefilename + $currpart + $extension
   $currentfilename
     $os = new-object System.IO.FileStream($currentfilename, [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write)
   $os.open
   $sw = new-object System.IO.StreamWriter($os)
  
   $linecount = 0

   # while there is a line to read  
   while ($sr.Peek() -ge 0)
   {
      # read a line
      $i = $sr.ReadLine()

      #check to see if we are past a line limit and we have found a good breaking point for the file
      if (($linecount -gt 60000) -and ($i.SubString(0,11) -eq "INSERT INTO"))
      {         
                 
          $sw.flush()
          $os.close()

          $currpart = $currpart + 1
          $currentfilename = $basefilename + $currpart + $extension
          $currentfilename
         
          $os = new-object System.IO.FileStream($currentfilename, [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write)
          $os.open
          $sw = new-object System.IO.StreamWriter($os)
           
          $sw.writeline($i)
          $linecount = 0

      }
      else
      {
        $sw.writeline($i)
        $linecount = $linecount + 1
      }  
   }
          
   $sw.flush()
   $os.close()     
   $fs.close()     
        
}
 

 

 

 

 

[Development , C# , .NET ] 31 October, 2007 05:10

With the xsd.exe included in Visual Studio, creating a object based on your XML file is easier than ever. 

  1. Open "Visual Studio 2005 Command Prompt"
  2. run the followin commands replacing file with your own file
    1. xsd file.xml
    2. xsd file.xsd /c /o  (file.xsd is created from the first command)
  3. file.cs will be created, move this to your project directory
  4. Add file.cs to you Visual Studio Project
  5. Use the folloing code to read the XML where "yourFields" is replaced with the class in file.cs and "YourData" is a string of the xml data

    XmlSerializer serializer = new XmlSerializer(typeof(yourFields));

    XmlTextReader rdrYourFields = new XmlTextReader(new System.IO.StringReader(YourData));

    yourFields fields = (yourFields)serializer.Deserialize(rdrYourFields);

[General ] 30 October, 2007 06:59
I will be posting snippets relating to C#, SharePoint and .NET coding.