Friday, June 30, 2017

Tuesday, June 13, 2017

simple example of async saving time

    static async Task<string>  blah()
        {
            await Task.Delay(5000);
            return "blah " + DateTime.Now.ToString();  
        }

        static async Task<string> masterblah()
        {
            Task<string> a =  blah();
            Task<string> b =  blah();
            Task<string> c =  blah();

            string a1 = await a;
            string b1 = await b;
            string c1 = await c;
            Console.WriteLine( string.Format("{0}-{1}-{2}", a1, b1, c1));
            return string.Format("{0}-{1}-{2}", a1, b1, c1); 
        }
       
        static void Main(string[] args)
        {

            Console.WriteLine(DateTime.Now);

            masterblah();

Thursday, June 8, 2017

Lync not starting

I killed the process (communicator.exe) and removed the cache

Monday, June 5, 2017

sp to help create table for user defined table

ALTER  PROCEDURE [ADMIN].[GET_UDF_TABLE_INFO]
(
       @p_NAME VARCHAR(100)
)
AS
BEGIN
       BEGIN TRY
       select tt.name AS TableName, c.name AS ColumnName,st.name AS DataType
       from sys.table_types tt
              INNER JOIN sys.columns c on c.object_id = tt.type_table_object_id
              INNER JOIN sys.systypes AS ST  ON ST.xtype = c.system_type_id
       where  tt.name  = @p_NAME
  order by c.column_id

      
       END TRY

       BEGIN CATCH
              EXECUTE ADMIN.LOG_DB_ERROR;
              return 0
       END CATCH
END

 order by c.column_id is real important because ado.net is ordinal




Context in WCF service is null

make sure
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"  />
is set

Debug Unit Test in VS

  1. Press CTRL+R and then CTRL+T.