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;
Thursday, March 13, 2008
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;
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
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
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.
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.
Sunday, March 9, 2008
Java Jazzup
Resources for Java developers:
Java Tutorials home: http://www.roseindia.net/
Ajax Tutorials: http://www.roseindia.net/ajax/
DOJO Tutorial: http://www.roseindia.net/dojo/
EJB Tutorial: http://www.roseindia.net/ejb/
Hibernate Tutorial: http://www.roseindia.net/hibernate/
J2ME Tutorial: http://www.roseindia.net/j2me/
Java Tutorials: http://www.roseindia.net/java/
Servlets: http://www.roseindia.net/servlets/
JSF: http://www.roseindia.net/jsf/
JSP Tutorials: http://www.roseindia.net/jsp/
Junit: http://www.roseindia.net/junit/
Maven 2: http://www.roseindia.net/maven2
MySQL: http://www.roseindia.net/mysql/
Spring Tutorials: http://www.roseindia.net/spring/
SQL Tutorials: http://www.roseindia.net/sql/
Struts Tutorials: http://www.roseindia.net/struts/
Web Services: http://www.roseindia.net/webservices/
XML Tutorials: http://www.roseindia.net/xml/
Ask Questions: http://www.roseindia.net/roseindiamembers/
Browser questions and answers: http://www.roseindia.net/answers/questions/
Java Tutorials home: http://www.roseindia.net/
Ajax Tutorials: http://www.roseindia.net/ajax/
DOJO Tutorial: http://www.roseindia.net/dojo/
EJB Tutorial: http://www.roseindia.net/ejb/
Hibernate Tutorial: http://www.roseindia.net
J2ME
Java Tutorials: http://www.roseindia.net/java/
Servlets: http://www.roseindia.net
JSF: http://www.roseindia.net/jsf/
JSP Tutorials: http://www.roseindia.net/jsp/
Junit: http://www.roseindia.net/junit
Maven 2: http://www.roseindia.net
MySQL: http://www.roseindia.net/mysql
Spring Tutorials: http://www.roseindia.net
SQL Tutorials: http://www.roseindia.net/sql/
Struts Tutorials: http://www.roseindia.net
Web Services: http://www.roseindia.net
XML Tutorials: http://www.roseindia.net/xml/
Ask Questions: http://www.roseindia.net
Browser questions and answers: http://www.roseindia.net
Subscribe to:
Posts (Atom)