Wednesday, August 29, 2012

Linq distinct count of a value in a datatable


   var countings  = (from row in ti.Table.AsEnumerable()
                            select row["blah"].ToString()).Distinct();
            if(countings.Count<string>() > 1)
            {

Linq top N from datatable to new datatable


var dtTrec = from item in dt.AsEnumerable()
                                     select item;
                        var topN = dtTrec.Take(20);
                        DataTable dt1 = topN.ToArray().CopyToDataTable<DataRow>();

Location of installutil

may be here under the current version

C:\Windows\Microsoft.NET\Framework\

deleting windows services

from command line

sc delete blah

reduce size xap issue

I made a dll reference to local copy = false and the published xap file still had the dll

I had to clean the project for this to work

Tuesday, August 28, 2012

interesting issue with 3rd party components

if they are not properly titlecased - this will mess up the designer class  as it will copy the way its spelled in aspx page

Friday, August 24, 2012

going up paths ..

where the paths lead nowhere  (e.g. /../../../../  at http:\\blah.com/herby )will still resolve to the last place it go up to.
this can be a source of subtle bugs.

Wednesday, August 15, 2012

Nlog file name

can be a regular file path not just an URL

Friday, August 10, 2012

string.empty as a default parameter

fails because it's declared thusly:

public static readonly string Empty 
not a constant

Why WCF doesnt work with static methods

I saw a lot of disinformation - the reason is simple - because contracts are interfaces and interfaces don't work with static methods.

Thursday, August 2, 2012

The viewstate is invalid for this page and might be corrupted

I experienced this today.

I have to quote

a developer I greatly admire - I was showing him an issue I was working on and he said "are we working too hard over here?"
which is so very true when you get stuck in something and what you really have to do is to step back and see if there isn't an easier solution

Cookies

will be case sensitive. Beware