Thursday, October 18, 2012

Finding duplicate Row in sql Server

Select name from Table_Personal group by name having (count(*) >1)

Update Top 1 row in Sql Server

Update Top (1) Tab_Test set name='' where serialNum=1

Sunday, October 14, 2012

Set Sql Server Time Out in ASP.Net

How to Solve timeout expired problem:

simply Add in your web.config file inside ConnectionString;
<connectionStrings>
<add name="connect" connectionString="DataSource=MYPC;Initial Catalog=North;TimeOut=120"/>
</connectionStrings>
If u use a SqlCommand object in your code:
Then use

SqlCommand cmd=new SqlCommand();
cmd.TimeOut="180";