IIS Errors on Windows XP: Failed to access IIS metabase, and Mutex could not be created

26 בפברואר 2008

  Failed to access IIS metabase System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase I solved this by Reinstalling the .NET 2.0 Framework via aspnet_regiis -i   Mutex could not be created System.InvalidOperationException: Mutex could not be created The Solution for this error is bit more complicate: Close all opened Visual Studios. Navigate to C:\Windows\Microsoft.NET\Framework\v2\Temporary ASPNET pages. Delete the folder for your application (You can delete the temporary folder completley) Perform IISReset via command line or via inetmgr.exe Browse your application directly from IIS and not from any where else. You should see your application correctly now. Good Luck !
תגיות: ,
אין תגובות

LINQ To SQL – Executing Text Queries

25 בפברואר 2008

Executing text queries with LINQ is simple as that...   Assuming you have installed. public void DoExecuteQuery() { AdventureWorksDataContext aw = new AdventureWorksDataContext(); IEnumerable<Employee> employees = aw.ExecuteQuery<Employee>("SELECT * FROM HumanResources.Employee"); foreach (Employee e in employees) { Console.WriteLine(e.Title); } }
2 תגובות

LINQ To SQL – Performing Inner Join Queries

24 בפברואר 2008

Its amazing how simple it is to create inner join queries with LINQ.   Assuming you have the AdventureWorks Database installed.   public void GetEmployeeByID(int employeeID) { AdventureWorksDataContext aw = new AdventureWorksDataContext(); aw.Log = Console.Out; var entities = from e in aw.Employees join ea in aw.EmployeeAddresses on e.EmployeeID equals ea.EmployeeID ...
תגיות: , ,
אין תגובות

LINQ To SQL – Get the SQL text query

Usually when we perform a LINQ Query on a SQL table, we don't see the actual query. Assuming you have the AdventureWorks Database installed. To see the query text, use the Log method: aw.Log = Console.Out   public List<Employee> GetEmployees() { AdventureWorksDataContext aw = new AdventureWorksDataContext(); var employees = from emps in aw.Employees select emps; aw.Log = Console.Out; return...
תגיות: , ,
אין תגובות

CompositeControl or WebControl

11 בפברואר 2008

Whenever possible, i rather to use UserControl instead of WebControl, since WebControls are more complicate to create and later on to maintain. But in case that i have to build a WebControl, i rather build a CompositeControl. Way CompositeControl? CompositeControl eventually inherit from WebControl, but each control inside the CompositeControl manage its own life cycle events and the ViewState / PostBack data. This means that we going to save a lots of code writing by not handling this events our self's. Implementing the CompositeControl Create the following code in a new Class Library: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace BaseType.Composite.Controls { public class...
3 תגובות

Populate Hierarchical Controls Using Database

ASP.NET offers some nice tools to use with our common web sites development. Some of them is the Menu and TreeView controls.   Consider the following SQL Table:         lets say I want to display all the child categories under there parent categories in a nice DHTML menu.   First Step - Add a Menu control to the ASPX file. <asp:Menu runat="server" ID="Menu1"> <DataBindings> <asp:MenuItemBinding TextField="CategoryName" /> </DataBindings> </asp:Menu>   Select...
15 תגובות

Mapping project (references) dependencies

9 בפברואר 2008

Soooo, its been very busy 2 months for me. I've started a new project for one of my company customers. I also passed 2 MCP exams 70-356 / 70-528 which makes me an MCTS - "Microsoft Certified Technology Specialist", and still I have few more test to become an MCSD.   In the new project I started, I needed to map all the references dependencies between the 52 (!!!) class libraries exists in the solution - Its very hard to map this manually, and probably will take me forever. I found that .NET Reflector can answer...
4 תגובות