Friday, October 15, 2004

Value Types

We know that all the primitives types are derived from the System.ValueType.

Have you ever wondered what would happen if you write:

System.ValueType x = 10;

So whats the type of 'x'. If you do a GetType() on x you will find out that the type is Int32. What it does is it assigns 'x' the type dependent upon the value of 'x'.

After the above statement if you say:

x = 23.45;

It will be treated as double Cool right :).

Check my articles on my website www.azamsharp.cjb.net in which I talked about Boxing and UnBoxing you will find more about System.ValueType.

Tuesday, October 05, 2004

NewLine in Repeator Control

You can easily display the data ( Item Template ) on newlines if you use the DIV
Tag. Meaning that inside the DIV tag write the Item Template tag and it will automatically create data or items on newline in the Repeator control.


Sunday, October 03, 2004

IF-ELSE statements

Its really cool to see that sometimes simple if-else conditional statements can be so confusing.

Here is a conditional statement:

if( 1 == 1 ) // You can make any condition it does not matter
string myString = "Hello World";

What do you expect will it run or not ? Well it will not run and give you error "Embedded statement cannot be a declaration"

You can write the same statement correctly if you add the paranthesis like this:

if( 1 == 1 )
{
string myString = "Hello World";
}

Do you find it amazing cause I sure do ?

Sending Parameters to MapQuest QueryString

Its really easy to embed your text with MapQuest QueryString. Like in the url below I did a MapQuest request depending on two zipcodes.

http://www.mapquest.com/directions/main.adp?go=1&do=nw&un=m&2tabval=address&cl=EN&ct=NA&1tabval=address&1y=US&1a=&1c=&1s=&1z=77004&2y=US&2a=&2c=&2s=&2z=77082&idx=0&id=41602f43-002a1-002b4-cdbcf381&aid=41602f43-002a2-002b4-cdbcf381&bs.x=0&bs.y=0

If you look at the URL closely you can see the ZipCodes 77004 and 77082. You can embed your own variables and values in this querystring and get the address/directions depending upon the parameters which are send by you from your own application.

Saturday, October 02, 2004

XML Schema Defination Tool

Just came arround this great tool. Its called XML Schema Defination Tool or xsd. It can convert your C# or VB.NET .cs (class file) to a XML Schema (xsd) file and vice versa.

It can also translates your untyped DataSet to Strongly typed DataSet. For more information see www.msdn.microsoft.com .