Thursday, March 24, 2011

simple logger code in C#

using System.Diagnostics;
TraceListener logger;
string LogFile = ClientClaimsLoad.Properties.Settings.Default.LogFile;
logger = new TextWriterTraceListener(LogFile);

Trace.Listeners.Add(logger);
Trace.WriteLine("Process started at " + DateTime.Now.ToString());

Trace.Flush();
Trace.Listeners.Remove(logger);
logger = null;
Trace.Write("Process ends at {0}\r\n", DateTime.Now.ToString());

Saturday, February 19, 2011

4 Biggest Lies in Real Estate

CLICK HERE


Some sites to research about to sell or buy house.

1) Zillow
2) CyberHomes
3) Realtor.com
4) RealEstateABC.com


Your mortgage rate site
1) Bankrate.com
2) PriceLine
3) AnnualCreditReport.com

Thursday, February 3, 2011

SSIS Excel connection error

SSIS - excel source error in BIDS - 2008

[Excel Source [528]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.
The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC00F9304.
There may be error messages posted before this with more information on why the AcquireConnection method call failed.


Solution:

go to Projects > Properties > Debugging and change "Run64BitRuntime" to "False"

Monday, January 31, 2011

Thumb Rules for Saving and Retirement

1) do not buy house that cost you more then 2 and 1/2 years of your income
2) save 10% of your income towards your retirement.
3) percentage of portfolio invested in bonds/stock EQUAL TO your AGE
4) never withdraw more then 4% from your retirement savings
5) Stock market would avg. return 10% (long term)
6) emergency fund - 6 month worth of house hold expanses
7) pay high interest credit card bill (debt) first
8) you should have 5 times of your gross salary for unexpected life insurance for family


CLICK HERE


follow this rules

Thursday, January 20, 2011

LINQ join two tables with condition

here is code

var result = from a in dbcontext.dbone
where a.state== "MD" && a.name == "Prashant"
join b in dbcontext.dbtwo
on select new {a.ID,a.DOB,a.GENDER}
equals select new {b.ID,b.DOB,b.GENDER}
select a;

store procedure with return type table in linq

use

SET FMTONLY OFF
in SQL store procedure and following in LINQ code

var MemDetailsOrdered = DataContext.GetOrderedElig(param1,param2,param..).ToList()

other wise it will return default int type