Posted by: msqr | December 25, 2008

Mapping SQL server, CLR, C# and ADO.NET datatype

I was looking for something to pass correctly data to SQL Server, and I got it right there on MSDN – excellent table showing mapping among CLR, C#, System.Data DataType and SQL Server datatype.

SQL Server Data Type Mappings (ADO.NET)

Advertisements
Posted by: msqr | November 15, 2008

Advertisement

var AdBrite_Title_Color = ‘0000FF’;
var AdBrite_Text_Color = ‘000000’;
var AdBrite_Background_Color = ‘FFFFFF’;
var AdBrite_Border_Color = ‘CCCCCC’;
var AdBrite_URL_Color = ‘008000’;
try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==”?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe=”;var AdBrite_Referrer=”;}

document.write(String.fromCharCode(60,83,67,82,73,80,84));document.write(‘ src=”http://ads.adbrite.com/mb/text_group.php?sid=925095&zs=3330305f323530&ifr=’+AdBrite_Iframe+’&ref=’+AdBrite_Referrer+'” type=”text/javascript”>’);document.write(String.fromCharCode(60,47,83,67,82,73,80,84,62));

Posted by: msqr | October 6, 2008

Compare LCD vs CRT

Here’s a link providing nice comparison you can use when you purchase a monitor – LCD or CRT. Most important factor I found useful for IT companies is Energy saving i.e. Power consumption and amount of heat emitted.

http://www.planar3d.com/3d-technology/lcd-vs-crt/

Posted by: msqr | September 28, 2008

Mapping XSD Type with .NET type

If you are looking for transferring binary data over SOAP, Here’s the link where you can find that equivalent of .NET byte[] is base64binary in XSD type.
XSD Type and .NET Type

Posted by: msqr | September 27, 2008

Choose right harddrive for VisualStudio development

Usually everyone cares about CPU/RAM when buying a new machine. But, we often ignore harddrive when building our Dev Machine.Drive for visual studio

Next, time before you complain – Visual studio or MS sucks, watch RPM of your harddrive.

Happy coding

Posted by: msqr | September 1, 2008

XMLSerialization Tips n Tricks

Posted by: msqr | August 26, 2008

default namespace and prefix in Root node of XML

Desired XML string:

<ns0:Product xmlns:ns0=”https://msqr.wordpress.com/Serialization/Product”><ProductID>12345</ProductID><ProductName>SC12345</ProductName></ns0:Product&gt;

here, ns0:Namespace prefix

xmlns=”https://msqr.wordpress.com/Serialization/Product&#8221; is the default namespace. When you have root node with namespace prefix, its called Qualified root. If you notice this xmlstring closely then it contains “https://msqr.wordpress.com/Serialization/Product”  All the elements do not have namespace prefix, i.e. they are unqualified in XML Lingo.

Let’s say you have a simple Product entity, decorated with XMLRoot

using System.Xml;
using System.Xml.Serialization;
using System.Text;
[XmlRoot(ElementName = “MyProduct”,IsNullable = false)]
public class Product
{
private int _productID;

[XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
public int ProductID
{
get { return _productID; }
set { _productID = value; }
}

private string _productName;

[XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
public string ProductName
{
get { return _productName; }
set { _productName = value; }
}

}

What about code to serialize Product entity to Desired XML?

public static string ToXML(Product prod)
{
XmlSerializerNamespaces ns=new XmlSerializerNamespaces();
ns.Add(nsPrefix,nsURI);

XmlRootAttribute xRoot=new XmlRootAttribute();
xRoot.Namespace=nsURI;

//Create XMLWriter with Settings
XmlWriterSettings xwSettings=new XmlWriterSettings();
xwSettings.OmitXmlDeclaration=true;
xwSettings.Encoding=Encoding.UTF8;

StringBuilder output=new StringBuilder();
XmlWriter xw=XmlWriter.Create(output,xwSettings);

//Serialize Product object to output
XmlSerializer x=new XmlSerializer(prod.GetType(),xRoot);
x.Serialize(xw,prod,ns);
return output.ToString();
}

Feel free to dop your comments.

Posted by: msqr | August 15, 2008

Official Windows 7 blog available

It’s Windows 7(Code named Viena), next major version of Windows after Vista. Also called as Windows Engineering 7 or E7. Lot of us might be thinking that still we have not had our hands settled on Vista and MS is thiking to push new OS! Yeah, if we look back then MS has been working really hard on Windows 7 after releasing Vista – around 18 months from now.

Now, they are begining to open their mouth and this time very cautious(Bad exp in the Vista days due to hype). In Vista, major focus was on security and graphics. This time focus is on touch-gesture based interfaces(reminds me of Cool Apple iPod to shuffle the songs), also MS is hoping to stich some of the gaps in depedencies and possibly replacing managed GUI provided in Vista with unmanaged counterparts to boost performance. Also emphasis will be on taking advantage of latest DirectX and may be rolling .NET FX 4.0 as part of OS.

MS will give developers more details on Windows7 in the upcoming PDC 2008 held at Los Angelos in the late October, hold your breath till then!

Link to official MS blog on Windows7 –Official Windows 7 blog

Unofficial but very technical blog that answers – “Whats new, now?” 5 Pillars of Windows 7

Excellent post on what I was thinking to cover in my blog
http://www.winterdom.com/weblog/archives/000545.html

Posted by: msqr | July 15, 2008

Windows Forms or WPF

With Microsoft offering multiple technologies to solve a given problem, this days architects/developers have to be careful that they make the right choice. I got into a similar situation, whether to choose Windows Forms or WPF…As usual I started Google and I found the quick run-down here…
When to adopt WPF

Excerpt from the above link:
Going forward, Windows Presentation Foundation will be Microsoft’s solution for most types of applications including standard forms-based applications. WPF is a foundation which goes beyond traditional platforms and other user interface toolkits. The potential with the WPF platform is to build applications that set a new bar for sophistication, usability and user experience.”

« Newer Posts - Older Posts »

Categories