Thursday, November 19, 2009

Most of the time, we, developers, creates temp tables in our stored procedures in order to store temporary data. We, sometimes, encounter an issue when we run that stored procedure, we got exception that #temp table already exists and user doesn't get what he wants.



After doing some RnD, i found a solution which really helped me a lot. Please use below TSQL statement(MS SQL SERVER) before you create any temp table.
if object_id('tempdb..#TableName) is not null drop table #TableName
then create your #TableName.
It will definitly help out alot in getting rid of displayed exception.

Tuesday, November 10, 2009

Cannot use a leading .. to exit

Last week, When we moved our application from staging site to production site, we were encountered an interesting exception.


Cannot use a leading .. to exit above the top directory.


Screenshot is attached herewith.





Please note that we are using Master pages in our application and we had included javascripts and CSS files in this master page. After googling through different forums, I found that ../javascript/a.js was causing this error.



Actually, in our staging site, it worked perfectly because ../ was finding parent directory but when that master page moved in parent directory, it didn't had 1 futher parent/top directory. We solved this exception using ~/ sign instead of ../