Tuesday, August 30, 2016

SQL Sample insert sample with declare



Declare @acc1 int
Declare @acc2 int
Select @acc1 = account_id from account where account_number = 'test'
Select @acc2 = account_id from account where account_number = 'test1'



update account_dependency set end_year = 2015
where account_id = @acc1
and dependent_account_id = @acc2
and effective_year = 2012



Insert into account_dependency (account_id, dependent_account_id, curr_year, factor, effective_year, end_year)
values (@acc1, @acc2, 0, 0.800000000, 2016, NULL)

Wednesday, August 10, 2016

Error CS0433 “file' already exists in both xxx.dll and yyy.dll Solution

When this issue is not caused by a bug in the application (e.g., duplicate class name):
This issue appears to present after a change is made to the application's project that results in a new build (e.g., code/reference/resource change). The issue appears to lie within the output of this new build: for various reasons Visual Studio is not replacing the entire contents of your application's obj/bin folders. This results in at least some of the contents of your application's bin folder being out of date.
When said issue occurs, clearing out the "Temporary ASP.NET Files" folder, alone, does not solve the problem. It cannot solve the problem, because the stale contents of your application's bin folder are copied back into the "Temporary ASP.NET Files" folder the next time your application is accessed, causing the issue to persist. The key is to remove all existing files and force Visual Studio to rebuild every object, so the next time your application is accessed the new bin files will be copied into the "Temporary ASP.NET Files" folder.
Solution
  1. Close Visual Studio
  2. Perform an iisreset
  3. Delete all the folders and files within the "Temporary ASP.NET Files" folder (the path is referenced in the error message)
  4. Delete the offending application's "obj" and "bin" folders
  5. Restart Visual Studio and open the solution
  6. Perform a "Clean Solution" followed by a "Rebuild Solution"
Explanation
  • Steps 1-2: remove resource locks from the folders/files we need to delete.
  • Steps 3-4: remove all of the old build files
  • Steps 5-6: create new versions of the build files