Friday, April 17, 2015

Linq Convert DateTime? to DateTime in ("dd/MM/yyyy")

Sql Query:
SELECT convert(varchar,[addedat],103) as addedat FROM tblTable


Linq Query:

 var query = from q in entity.tblTable
                    select new
                    {
                     
                        date = SqlFunctions.DateName("day", q.addedat).Trim() + "/" +
                            SqlFunctions.StringConvert((double)q.addedat.Value.Month).TrimStart() + "/" +
                            SqlFunctions.DateName("year", q.addedat),
                    };

Tuesday, November 11, 2014

Install-Package : The current environment doesn't have a solution open.

This error occur , if you not save your solution .sln file. use file-?>saveall.


Tuesday, September 23, 2014

Method error 500. for binding combobox ,dropdown from webservice

Add following code in web.config configuration section.



   
     
       
     

   

 

Thursday, July 18, 2013

System.ArgumentException: The version of SQL Server in use does not support datatype 'datetime2'.

It turns out that Entity Framework 4 somehow got the idea to use SQL Server 2008. The fix was to edit the .edmx file in an XML editor and set the ProviderManifestToken="2005" instead of 2008. (You need to rebuild.)