Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development .Net Framework
Methods to verify, are DataTables or DataSets the same.
I wanted to verify, are DataTables in DataSets the same. I found a few similar implementations on StackOverflow, but the one that I've selected (http://stackoverflow.com/q... didn't work and returned unexpectedly false, when comparing two cells with the same values tbl1.Rows[i][c] 2 object {long} tbl2.Rows[i][c] 2 object {long} tbl1.Rows[i][c] == tbl2.Rows[i][c] false I found, that it should be used Equals instead of ==. Equals(tbl1.Rows[i][c], ......

Posted On Tuesday, August 27, 2013 9:49 PM

Number of Unit test projects in Visual Studio solution
Some time ago I have discussion with my co-worker how to organize test projects. Should we have a single test project that does all sorts of things and references every project?It is good to have one integration test dll, but for unit tests, what is the point merging everything into one.In ideal world I agree that small independent projects are better. Unfortunately we have solution size limitations From http://stackoverflow.com/qu... ......

Posted On Sunday, June 9, 2013 12:11 PM

My StringArrayHelper class
Previously I've posted a few Helper Classes . This post describes my StringArrayHelper class: using Iesi.Collections; using Microsoft.VisualBasic; using Microsoft.VisualBasic.Compi... using System; using System.Collections; using System.Runtime.CompilerServ... using System.Xml; using System.Text; public static class StringArrayHelper { //created from CollectionsHelper.cs // Methods //'ignore new string, if already exist in the array // empty string considered as separate entry // function ......

Posted On Monday, October 8, 2007 12:44 AM

My DateTimeHelper class
Previously I've posted a few Helper Classes . This post describes my DateTimeHelper class. using System; using System.Collections.Generic; using System.Text; using Microsoft.VisualBasic.Compi... using Microsoft.VisualBasic; using System.Diagnostics; public static class DateTimeHelper { public static DateTime DateAndTime(DateTime dateValue, DateTime timeValue) { DateTime time2; time2 = new DateTime(dateValue.Year, dateValue.Month, dateValue.Day, timeValue.Hour, timeValue.Minute, timeValue.Second); ......

Posted On Wednesday, September 12, 2007 6:37 PM

My CollectionsHelper class
Previously I've posted a few Helper Classes . This post describes my CollectionsHelper class. ///<summary> /// //from http://diditwith.net/PermaL... ///</summary> ///<example> ///<code> ///</code> ///</example> public static class CollectionsHelper { /*When C# extensions will be available( promised in C# 3, add this keyword to parameter * public static bool IsNullOrEmpty(this ICollection c) //from http://diditwith.net/PermaL... ......

Posted On Tuesday, July 17, 2007 12:51 AM

My RegexMatchsHelper class
Previously I've posted a few Helper Classes . This post describes my RegexMatchsHelper class I also added a few related links: Use Regular Expressions to Constrain Input in ASP.NET using System; using System.Diagnostics; using System.Text.RegularExpressi... ///<summary> /// Summary description for RegexMatchs. ///</summary> public class RegexMatchsHelper { public RegexMatchsHelper() { // // TODO: Add constructor logic here // } // public static void RetrieveMatchedStringTest() // { // ......

Posted On Wednesday, June 6, 2007 12:16 AM

My StreamHelper class
Previously I've posted a few Helper Classes . This post describes my StreamHelper class using Microsoft.VisualBasic; using System; using System.IO; using System.Reflection; using System.Text; using System.Diagnostics; public class StreamHelper { // 'See also FxLib Author: Kamal Patel, Rick Hodder // 'Find the first entry of sToFing and returns the string after it // 'See also FxLib StringExtract (and StuffString) // Methods public StreamHelper() { } #region "Stream and Resources Functions" //C# version ......

Posted On Tuesday, June 5, 2007 12:46 AM

My HttpWebRequestHelper class
Previously I've posted a few Helper Classes . This post describes my HttpWebRequestHelper class: using System; using System.Text.RegularExpressi... using System.IO; using System.Diagnostics ; using System.Net; namespace FSHelperLib { using System; using System.Text; // clarification from http://www.dotnetsmart.com/... // System.Web.HttpRequest is a class used on the server and inside an ASP.NET application. It represents the *incoming* request from a client. // System.Net.HttpWebRequest ......

Posted On Tuesday, June 5, 2007 12:19 AM

My EnumHelper class
Previously I've posted a few Helper Classes . This post describes my EnumHelper class. The class uses other helper classes, in particular CollectionsHelper Related links: Overriding ToString on enum, Mapping Text to Enum entries . Enum Helper Class Using Generics , My new little friend, Enum<T>, Making C# enums more usable - the Parse() method https://connect.microsoft.c... using System; using System.Collections.Generic; using System.Text; ......

Posted On Friday, April 20, 2007 12:36 PM

Invoke Executable as custom action during Install.
I've used MS Installer class to provide custom actions during setup in a few projects(e.g.see Using VS 2005 Web Setup Project with custom actions). However if you have some complex logic to do as a part of setup, it is possible that some exception will occur. I don't like to hide exceptions, and they are shown to the user,causing installation to rollback. It is not good, becuse sometimes user wants to ignore exception and use installation even if some custom action failed. I found that moving code ......

Posted On Wednesday, March 14, 2007 10:50 AM

Serialization error when property is declared as base class, but populated by derived class
I've receive quite generic error Message : Type 'MyclassType' with data contract name 'MyclassType:http://schemas... is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.Type : System.Runtime.Serializatio... mscorlib, Version=4.0.0.0, Culture=neutral, ......

Posted On Sunday, June 2, 2013 9:08 PM

Upgrading PostSharp from ver 2.1 to new version 3.0
I was upgrading our solutions from PostSharp 2 to PostSharp 3. The small solution based on cache attribute from http://cache.codeplex.com/ was upgraded without any problems.Upgrading my main solution by installing nuget package PostSharp also was quite well. The only annoying thing was that installer added RequiresPostsharp.cs file to all projects, that already had SkipPostSharp=true setting and I had manually remove themThe issue was reported athttp://support.sharpcraft... ......

Posted On Sunday, June 2, 2013 2:17 PM

AddIfNotNull collection extensions
I want to post a few recently created collection extensions to write in one line, what otherwise takes 2 or more public static void AddIfNotNull( this IList coll, T newItem) where T : class { if (newItem != null) { coll.Add(newItem); } } public static void AddRangeIfNotNullOrEmpty( this List coll, IEnumerable newItems) where T : class { if (!newItems.IsNullOrEmptySeq... { coll.AddRange(newItems); } } public static void AddIfNotContains( this Dictionary dictionary, TKey key, TValue value) { if ......

Posted On Saturday, May 25, 2013 10:20 AM

Do NOT Change "Copy Local” project references to false, unless understand subsequences.
To optimize performance of visual studio build I've found multiple recommendations to change CopyLocal property for dependent dlls to false,e.g. From http://stackoverflow.com/qu... CopyLocal? For sure turn this offhttp://stackoverflow.com... set the Copy Local property to false and enforce this via a custom msbuild stephttp://codebetter.com/p... ......

Posted On Sunday, December 9, 2012 1:15 PM

My ListOfStringsHelper class
I am using a few helper classes. This post describes my ListOfStringsHelper class. #region Namespace Importsusing System;using System.Collections.Generic;... System.Globalization;using System.Linq;using System.Text;using System.Diagnostics;#endregion //Namespace Imports namespace Common{// using System.Collections; //See also StringArrayHelper.cs, CollectionsHelper.cs public static class ListOfStringsHelper { public static bool StringContainsAnyFromList(L... patternsList, string sMsg) ......

Posted On Monday, May 7, 2012 10:26 PM

My EnglishGrammerHelper class
The class below is used to create adjustable messages using System; /// Summary description for EnglishGrammerHelper. /// </summary> public class EnglishGrammerHelper { public EnglishGrammerHelper() { // // TODO: Add constructor logic here // } /// <summary> /// Compiles sentence with person,verb and rest of the sentence /// </summary> /// <param name="person"></param... /// <param name="verb"></param> /// <param name="restSentence"><... /// ......

Posted On Sunday, May 15, 2011 2:03 AM

DataSetHelper Class that I am using
Previously I've posted a few Helper Classes . This post describes DataSetHelper class, that mostly based on series of MSDN articles. However I did some modifications(e.g see posts DataSetHelper.SelectDistinct method for multiple columns and “Handling missing source columns in DataSetHelper.InsertInto method” ) using System; using System.Data; using System.Data.SqlClient; using System.Diagnostics; using System.Collections; using Microsoft.ApplicationBlocks... using System.Collections.Generic; namespace ......

Posted On Thursday, October 18, 2007 2:31 AM

EntLIb editor corrupts config files
I've tried to use Microsoft Enterprise Library(EntLIb) editor, as it was suggested in http://weblogs.asp.net/suku... but after changes all comments in config files were removed. Always consider to move any Enterprise Library configurations to a separate file before editing ......

Posted On Saturday, February 16, 2013 3:45 PM

My FileHelper class
I've posted a few code snippets and some people noticed that there are references to unresolved methods.I am using a few helper classes. This post describes my FileHelper class: System.IO; /// <summary> /// Summary description for FileHelper. using /// See also StreamHelper class methods, e.g. SaveStringToFile,SaveToFile /// </summary> public static class FileHelper { public static string GetFileExtensionWithoutDot(... fileName) { string sExt=Path.GetExtension(file... if ((null==sExt) ......

Posted On Friday, February 2, 2007 10:05 AM

Encode Invalid characters in Visual SourceSafe file names.
Some time ago I had to create the utility to rename files with special characters to allow them to be inclyuded in Visual SourceSafeI've used VBeXpress generator, that had templates with ‘%’ in file names. Unfortunately the names with ‘%’ like %%Project.Name%%.sln are not acceptable by VSS due to invalid VSS syntax. This utility copies changed templates to files with encoded names,acceptable by VSS. It's allowed to check-in/check out individual files(with encoded names) and view thier changes/history. ......

Posted On Thursday, December 21, 2006 8:59 AM

Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net | Join free