select …,…, case result when 1 then ‘Pass’ when 0 then ‘Fail’ end as ‘Result’ ,…
Archive for the ‘ASP.net C#’ Category
Change value in qury using if
Posted: April 19, 2011 in ASP.net C#Tags: if in query, if in sql query, select case in sql query
NumberToEnglish conWord = new NumberToEnglish(); dt.Columns.Add(“AmountInWord”, Type.GetType(“System.String”)); DataRow row2; row2 = dt.Rows[0]; row2["AmountInWord"] = conWord.changeCurrencyToWords(sTHeadAmount.ToString());
Compute Function for data table
Posted: July 28, 2009 in ASP.net C#Tags: caluculation of columns of data tables, Compute Function for data table, compute values of data tables
int TotalAmount = Convert.ToInt32(dtTotalAmt.Compute(“SUM(amount_pay)”, “amount_pay > 0″)); RemAmount = RemAmount – HeadTotalAmount;
FxCop – code analysis tool
Posted: July 25, 2009 in ASP.net C#Tags: code analysis tool, code efficiency tool, FxCop, tool for coding standards
FxCop is a code analysis tool that checks .NET managed code assemblies for conformance to the Microsoft .NET Framework Design Guidelines. It uses MSIL parsing, and callgraph analysis to inspect assemblies for more than 200 defects in the following areas: Library design Globalization Naming conventions Performance Interoperability and portability Security Usage FxCop includes both GUI [...]
Date Difference in Asp.net
Posted: July 9, 2009 in ASP.net C#Tags: Date Difference in Asp.net, total days between two dates
string startDate = “4/24/2007″; string endDate = “3/24/2007″; DateTime sDate = Convert.ToDateTime(startDate); DateTime eDate = Convert.ToDateTime(endDate); TimeSpan dateDiff = eDate.Subtract(sDate); int days = dateDifference.Days;
In this example two tasks are covered 1. Crystal Report with dynamic column 2. Export data table Download Here Dynamic Report and Export to Excel