Monday, September 25, 2006

XSD to C# class or VB.net class

While working with biztalk using web services i found this as a must to have tool.
The XSD.exe from microsoft can be used for this.

The Sample Code Generator (XSDObjectGen) tool takes an XSD schema as input and generates sample code showing how to mark up C# and VB.Net classes so that when serialized with the XML serializer, the resulting XML will be valid according to the original schema.

Download link from microsoft

Friday, August 18, 2006

Accessing Request or Session objects from class modules

When we need to use a request object from another class modules we have to use the
HttpContext.Current object. This contains all the state informations like request, session, Server, Respose etc.
Eg:
string r = HttpContext.Current.Request["MyParam"].ToString();
string s = HttpContext.Current.Session["MySessionVar"].ToString();

Note: Add "using System.Web" to the header.

Wraping Session to Gobal Session Class


using System;
using System.Web;

namespace MyApp
{
public class SessionGlobal
{

private const string _AccountNo = "_AccountNo";

// Set to default Values
public static void Clear()
{

HttpContext.Current.Session[_AccountNo]="";

}

private static string getSessionVar(string key)
{
if(HttpContext.Current.Session[key]!=null)
return HttpContext.Current.
Session[key].ToString();
else
return "";

}

public static string AccountNo
{
get
{
return getSessionVar(_AccountNo);
}
set
{
HttpContext.Current.Session[_AccountNo]=value;
}
}

public static string UserID
{
get
{
return HttpContext.Current.
Request.ServerVariables["AUTH_USER"];
}

}

}
}

Software requirements for a complete installation of BizTalk Server 2006

The minimum software requirements for a complete installation of BizTalk Server 2006 on a single computer:

  • Windows Server 2003 with Service Pack 1
  • Microsoft Office Excel 2003 and InfoPath 2003 with Service Pack 2
  • Microsoft Visual Studio 2005 with Microsoft Visual C# .NET
  • Microsoft SQL Server 2005 or Microsoft SQL Server 2000 with Service Pack 4
  • Microsoft SQL Server 2005 Analysis Services or Microsoft SQL Server 2000 Analysis Services with Service Pack 4
  • Microsoft SQL Server 2005 Notification Services or Microsoft SQL Server 2000
  • Notification Services 2.0 with Service Pack 1
  • Microsoft Windows SharePoint Services 2.0 with Service Pack 2

Tuesday, February 21, 2006

Create a simple Serial/row No column in Datagrid/DataList

A very simple way to create Serial/row No column in Datagrid/DataList

create a variable in the code behind


protected int i=1;

Now in the Datagrid/DataList add a TemplateColumn with data bound to the variable



<asp:TemplateColumn HeaderText="SL#">
<ItemTemplate>
<%# i++ %>
</ItemTemplate>
</asp:TemplateColumn>


This may not be usefull for item identification when used in sortable grid