Skip to main content

Posts

SQL Update From One Table To Another Based On A Id Match

I have an employees table and an EmployeeTerritories table. The employeeid in both these tables are in integer datatype.   I have to create a new unique identifier column in both these tables and then update them accordingly. 1. I created a newsequentialid column in the employees table that will create new ids for the employees 2. Next, i added a new column to the employee territories table and set it as a foreign key to the employees table 3. now, i am in need of a query that will fetch the new guid from the employee table and fill in the employee territories table 4. i need to have a single update statement that do the trick by making use of the existing numerical id values UPDATE EmployeeTerritories SET empid = Id FROM EmployeeTerritories INNER JOIN Employees ON Employees.EmployeeID = EmployeeTerritories.EmployeeID This update statement will update the empid in the territories table based on the id matching. This saves a lot of time in comparison to the manual match

HOW TO Use IIS Express From The Command Line

The following code snippet can be used to run the IIS Express [8.0] in my case to be run from the command line. The parameters are the path to the main directory, the target libraries [dll's] should be in a folder  called as “bin” inside this given path for the IIS to pick up and run. The other parameter is the “port” which specifies which port should IIS Express listen for the incoming request. It also logs in the requests and the response status etc in the command line. Sample : c:\Program Files\IIS Express>iisexpress.exe /path:”C:\Users\Saravanan\Documents\Visual Studio 2012\Projects\console_app_in_iis\console_app_in_iis” /port:8089

OWIN and Katana

This post illustrates the compatibility of OWIN with the existing technologies MVC5 requires ASP.NET/IIS but can co-exist with OWIN components. MVC is tightly coupled to ASP.NET, hence not standalone with respect to OWIN WebApi is fully OWIN compatible In order to find out where your app is loaded from, use “AppDomain.CurrentDomain.SetupInformation.ApplicationBase”  The stage markers apply to OwinHttpModule, not OwinHttpHandler

How is Routing done in ASP.Net MVC

How routing is done in asp.net mvc Each route contains the following info, 1. the url 2. the curly braces that specify the match 3. the constraints for the inputs in the url parameters Each route should be anything that inherits from the RouteBase. **************** foreach route in the routescollection do, { 1. The url in the route should match the incoming url 2. The contents for the curly braces must match in the incoming url 3. The constraints should also match with the route taken from the routes collection. 4. If a match occurs, then the route is considered as a valid one } for every route match to be done, the routebase supplies the URL, the curlybrace dictionary with its replacement from the request URL, route parameter values with the optional ones for which no value was received from the i/p request. 3. The route handler is passed with the requestContext [url, cookies, authentication data, request data etc] once a first route match is done, the routing me