Solution:
Just go to server explorer, right click references and select System.XML from the .Net tab. Rebuild your project and the error should no longer be there.
Filed under: .net, Microsoft, Technical, XML | 2 Comments »
Solution:
Just go to server explorer, right click references and select System.XML from the .Net tab. Rebuild your project and the error should no longer be there.
Filed under: .net, Microsoft, Technical, XML | 2 Comments »
I wanted to do a case insensitive xpath lookup in my C# .Net application. There was no direct way that i could find to get the job done, but fortunately the workaround ain’t that difficult. Lets consider the following example:
<xml><books><book id=”1″ name=”Book1″ type=”fiction” /><book id=”2″ name=”Book2″ type=”nonfiction” /><book id=”1″ name=”Book1″ type=”FICTION” /></books>
To request for all [...]
Filed under: C#, Microsoft, Technical, Tips, XML | Leave a Comment »
I had a table with two columns: ID and Description. The task was to display the description of all elements whose ID is a power of two. Here’s the query that let me accomplish that:
SELECT ID, Desc FROM tblBits WHERE ID > 0 AND ID & (ID-1) = 0
How does this work?
Every power of two [...]
Filed under: Microsoft, SQL, SQL Server, Technical | Leave a Comment »
I was using ASP.NET 2.0 along with Ajax Extensions 1.0. I received this error ‘Sys’ is undefined error message every time I used an Ajax control. I was pulling my hair out on it and decided to give the Control Toolkit’s web.config a glance. The following lines were not available in my web.config, so i [...]
Filed under: .net, Ajax, C#, Code, Microsoft, Technical | 11 Comments »
I wanted to give WPF a try and was creating a timer application which will pop up a window once a while. But what I wanted was for the application to keep running in the tray even when its closed. The following code does NOT work in WPF for some reason:
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs [...]
I was using the StreamReader class to read the contents of a text file. I was under the assumption (well I know its a bad
thing) that because I am only reading the contents of the file, the file would be available for other applications to read or write. Guess what, i was wrong. The StreamReader [...]
Filed under: .net, C#, Code, Microsoft, Technical | 6 Comments »
Technorati Tags: Microsoft,Sysinternals,Filemon,Regmon,Autoruns,Process Explorer,Syinternals Live
If you are a Sysinternals fan then this one is for you. Microsoft has announced the launch of Sysinternals Live. Ever since Microsoft took over Sysinterals the one thing that i have detested is the need to search for a particular utility and scrolling to the bottom of the page just [...]
Filed under: Microsoft, Technical, Tools | Leave a Comment »
I created a new windows service and attached a App.Config file to it. Then I went back to the code and tried this:
System.Configuration.ConfigurationManager.GetSection(“Extras”);
For some reason the compiler was not able to figure out the class and kept throwing an error. This does not happen with your standard EXE projects as well as ASP.NET projects. I [...]
Filed under: .net, C#, Microsoft, Technical | Leave a Comment »
Using Persited Columns in SQL Server 2005 via t-sql and sql server management studio
Filed under: Code, Microsoft, Performance, SQL, SQL Server, T-SQL, Technical | Tagged: Computed Column, Management Studio, Persisted, SQL Server | 3 Comments »
W3C has defined a set of illegal characters for use in XML . You can find info about the same here:
XML 1.0 | XML 1.1
Here is a function to remove these characters from a specified XML file:
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
namespace XMLUtils
{
class Standards
{
[...]
Filed under: .net, C#, Code, Microsoft, Standards, Technical, XML | Tagged: Illegal Characters, W3c, XML | 18 Comments »