Archive

Posts Tagged ‘Microsoft’

Adieu “Windows XP”

May 21, 2014 1 comment

I still remember the first glance of “Windows XP” which gave a completely new dimensions towards how easy it was to use a Windows Operating System. Dusting old memories, it was sometime in 2012 when my father agreed to buy me a personal computer, it was P4 system with 2 GB RAM and a DVD drive with an addition of a TV Tuner card. This was a pre-configured system from a branded manufacturer “HCL” and this model was called as “Busy Bee” and came with the bundled operating system “Windows XP Home Edition”.

Back those days Windows 98 SE was still widely used and considered to be the best. But Windows XP ran like a champ and gave such a positive vibe and impressions to all of my friends and family. It’s been almost 11 years and still runs the same old Windows XP. What more can I say about such a thing which never gave a thought of an OS upgrade.

Yup! Bitter truth is Microsoft wants its users (like me) to upgrade its OS and get moving with the newest ones. Windows XP was a benchmark as to how an OS should be. The ones that impressed me next is Windows 7. Windows 8, yeah I still have to get adjusted with the usage but definitely didn’t impress me yet!

As of April 8, 2014, support and updates for Windows XP are no longer available. Check out this link: http://windows.microsoft.com/en-IN/windows/end-support-help

I would definitely miss you!

Categories: Personal Tags: , ,

VS 2013 Newest …

VS 2013 Newest Mentions includes MVC 5, Entity Framework and Web API 2

These might be only few mentions, refer to the following link for a much detailed one.

DataSet.ReadXmlSchema Method Limitations

February 23, 2011 2 comments

We basically use the DataSet.ReadXmlSchema Method to create the schema which includes table, relation, and constraint definitions for the Dataset. Having said this here is something that’s worth sharing to all of my fellow developers who happen to stumble upon this post in search of a situation to find that their dataset is loading incorrect tables when your xml schema is being read!

Case 1: Sample1.xsd

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:simpleType name="PropertyNames">
    <xs:restriction base="xs:string">
      <xs:enumeration value="prop1"></xs:enumeration>
      <xs:enumeration value="prop2"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="Items">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Item" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="name" type="xs:string"/>
              <xs:element name="properties" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

When you use the dataset’s “ReadXmlSchema” method you will find that the dataset will contain 2 tables!

// Create the DataSet to read the schema into.
DataSet ds = new DataSet();
// Invoke the ReadXmlSchema method with the file name.
ds.ReadXmlSchema(@"C:\\test\\Sample1.xsd");

A XML instance representation for this schema will be:

<Items>
  <Item> [1..*]
    <name> xs:string </name> [1]
    <properties> xs:string </properties> [0..*]
  </Item>
</Items>

Case 2: Sample2.xsd

<?xml version="1.0" encoding="iso-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:simpleType name="PropertyNames">
    <xs:restriction base="xs:string">
      <xs:enumeration value="prop1"></xs:enumeration>
      <xs:enumeration value="prop2"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="Items">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Item" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="name" type="xs:string"/>
              <xs:element name="properties" type="PropertyNames" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

This time when you execute the following code you will find that the dataset will contain 1 table!

// Create the DataSet to read the schema into.
DataSet ds = new DataSet();
// Invoke the ReadXmlSchema method with the file name.
ds.ReadXmlSchema(@"C:\\test\\Sample1.xsd");

Whereas the XML instance representation for this schema will be:

<Items>
  <Item> [1..*]
    <name> xs:string </name> [1]
    <properties> PropertyNames </properties> [0..*]
  </Item>
</Items>

Actually, you should have noted that thou the XML instance representation for this schema (Case 2) is similar to the one in (Case 1), the dataset had only one table instead of two; After several hours of investigation and read through, I happen to discover (atleast lucky) thats there is a “Microsoft Support Article” which explains the “Limitations for DataSet Schema Files (XSD)”.

Please find the references to the file at the following location: http://support.microsoft.com/kb/319372

Question: How does this article applies to my scenario?
Answer: Use of Restriction Element Is Mostly Ignored
You can derive a new simple type by restricting an existing simple type with the restriction element. When you use the restriction element in simple types, the restriction element is ignored. Therefore, all the sub-elements of that restriction element are ignored also.

All restriction elements are ignored except the XSD simple type “string”, and its facets as follows:
> length
> minlength
> maxlength

How to create a CAB (cabinet) file using C#

February 8, 2011 14 comments

At present we do not have classes in .NET that enable us to create CAB (cabinet) files, hence we has other third party libraries and toolsets that provide their custom classes, one such is Windows Installer XML (WiX) toolset (http://wix.sourceforge.net) which is distributed with a collection of dlls as part of its SDK and best of all is that this is developed by Microsoft and we have good support for WiX users.

In your .NET project add references to the following DLLs:
Microsoft.Deployment.Compression.dll
Microsoft.Deployment.Compression.Cab.dll

And we will be using this library (Microsoft.Deployment.Compression.Cab) for creating CAB (cabinet) files.

using Microsoft.Deployment.Compression.Cab;

In our example we will see how to add individual files to the CAB file and how to add a folder (directory) to the CAB file and finally how to extract (unpack) the CAB file.

// CREATING CAB FILE BY ADDING LIST OF FILES
CabInfo cab = new CabInfo(@"C:\testarchive1.cab");
List files = new List();
files.Add(@"C:\test1.txt");
files.Add(@"C:\test2.txt");
files.Add(@"C:\test3.txt");
cab.PackFiles(null,files,null);

// CREATING CAB FILE BY ADDING FOLDER (WITH SUB-FOLDERS) USING MINIMUM COMPRESSION
cab = new CabInfo(@"C:\testarchive2.cab");
cab.Pack(@"C:\Balaji", true, Microsoft.Deployment.Compression.CompressionLevel.Min, null);

// EXTRACTING (UNPACKING) FILES FROM CAB FILE
cab = new CabInfo(@"C:\testarchive1.cab");
cab.Unpack(@"C:\ArchieveDir");

IIS Server Variables

November 3, 2009 2 comments

IIS server variables provide information about the server, the connection with the client, and the current request on the connection.

IIS server variables are not the same as environment variables.

Paste the code given below in your asp.net web page [HTML Design] to see the information associated for each of the iis server variables.

<%Response.Write(HttpContext.Current.Request.ServerVariables["ALL_HTTP"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["ALL_RAW"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["APPL_MD_PATH"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["AUTH_TYPE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["AUTH_PASSWORD"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["AUTH_USER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_COOKIE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_FLAGS"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_ISSUER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_KEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SECRETKEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SERIALNUMBER"]); %>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SERVER_ISSUER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SERVER_SUBJECT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CONTENT_LENGTH"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CONTENT_TYPE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["GATEWAY_INTERFACE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_KEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_SECRETKEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_SERVER_ISSUER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_SERVER_SUBJECT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["INSTANCE_ID"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["INSTANCE_META_PATH"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["LOGON_USER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["PATH_INFO"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["PATH_TRANSLATED"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["QUERY_STRING"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["REMOTE_HOST"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["REQUEST_METHOD"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SCRIPT_MAP"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_PORT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_PORT_SECURE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_PROTOCOL"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["URL"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_CONNECTION"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_HOST"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_REFERER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_COOKIE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_UA_CPU "]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_ENCODING"]);%>

References: http://msdn.microsoft.com/en-us/library/ms524602.aspx

%d bloggers like this: