Thursday, March 13, 2008

Declaring Global Variables

A global variable is a variable that is accessible in every scope

New Class with Class Name: GlobalVars

public class GlobalVars
{
private static string cstmAccId;
public static string strcstmAccountId
{
get { return cstmAccId; }
set { cstmAccId = value; }
}
}

Assigning value to Global variable
GlobalVars. strcstmAccountId=”10”;

Accessing value of Global variable
String strId= GlobalVars. strcstmAccountId;

Monday, March 10, 2008

Convert RGB to CMYK in Delphi script

uses Math;

function RGBtoCMYK(const rgbColor : TRGBColor) : TCMYKColor;
begin
with Result do
begin
Cyan := 1 - rgbColor.Red;
Magenta := 1 - rgbColor.Green;
Yellow := 1 - rgbColor.Blue;

KeyPlate := Min(Min(Cyan, Magenta), Yellow) ;

Cyan := Cyan - KeyPlate;
Magenta := Magenta - KeyPlate;
Yellow := Yellow - KeyPlate;
end;
end;

var
rgbColor : TRGBColor;
cmykColor : TCMYKColor;

begin
rgbColor.Red := 128;
rgbColor.Green := 64;
rgbColor.Blue := 192;

cmykColor := RGBtoCMYK(rgbColor) ;

Caption := Format('%d-%d-%d-%d',[cmykColor.Cyan, cmykColor.Magenta, cmykColor.Yellow, cmykColor.KeyPlate])
end;

export datatable to excel

public static void ExportToSpreadsheet(DataTable table, string name)
{
HttpContext context = HttpContext.Current;
context.Response.Clear();
foreach (DataColumn column in table.Columns)
{
context.Response.Write(column.ColumnName + ";");
}
context.Response.Write(Environment.NewLine);
foreach (DataRow row in table.Rows)
{
for (int i = 0; i < table.Columns.Count; i++)
{
context.Response.Write(row[i].ToString().Replace(";", string.Empty) + ";");
}
context.Response.Write(Environment.NewLine);
}
context.Response.ContentType = "text/csv";
context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + name + ".csv");
context.Response.End();
}

Merge 2 datatset

''here ds1 in one dataset
''and ds2 as second dataset

here we want to merge the ds2 to ds1

ds1.Merge(ds2, False, MissingSchemaAction.Add)

Creating a ProgressBar with ASP.NET

http://aspalliance.com/760
http://forums.asp.net/p/1048429/1502684.aspx#1502684
http://forums.asp.net/p/1040649/1449185.aspx
http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/
http://www.aspdotnetcodes.com/GridView_Insert_Edit_Update_Delete.aspx
http://msdn2.microsoft.com/en-us/library/ms972940.aspx
http://aspalliance.com/1125_Dynamically_Templated_GridView

Image Manipulation

Top 1 to 50 Image Manipulation - ASP.NET scripts.

Blogs

http://www.gvramesh.wordpress.com
http://www.sathisht.blogspot.com
http://www.linux-osfop.blogspot.com
http://anotomyworld.blogspot.com
http://murumemory.blogspot.com
http://indianpoliticaldiary.blogspot.com
http://www.opennetguru.com

Ingres Vs PostgreSQL

Ingres (pronounced /iŋ-grεs'/) is a commercially supported, open-source relational database management system. Ingres was first created as a research project at the University of California, Berkeley starting in the early 1970s and ending in the early 1980s. The original code, like that from other projects at Berkeley, was available at minimal cost under a version of the BSD license. Since the mid-1980s, Ingres had spawned a number of commercial database applications, including Sybase, Microsoft SQL Server, NonStop SQL and a number of others. Postgres (Post Ingres), a project which started in the mid-1980s, later evolved into PostgreSQL.

PostgreSQL is an object-relational database management system (ORDBMS). It is released under a BSD-style license and is thus free software. As with many other open-source programs, PostgreSQL is not controlled by any single company, but relies on a global community of developers and companies to develop it.

PostgreSQL's unusual-looking name makes some readers pause when trying to pronounce it, especially those who pronounce SQL as "sequel". PostgreSQL's developers pronounce it /post ɡɹɛs kju ɛl/. It is also common to hear it abbreviated as simply "postgres", which was its original name. Because of ubiquitous support for the SQL Standard amongst all relational databases, the community considered changing the name back to Postgres. However, the PostgreSQL Core Team announced in 2007 that the product would continue to be named PostgreSQL. The name refers to the project's origins as a "post-Ingres" database, the original authors having also developed the Ingres database.