Monday, May 10, 2010

how to convert a dataset to excel?

public Stream ConvertDatsetToExcel(DataSet dataset)


{

Stream attachment = null;

string excelContent = "";



excelContent += "<>"; if (dataset.Tables[0].Rows.Count > 0) { excelContent += "<>"; for (int index = 0; index < dataset.Tables[0].Columns.Count; index++) { excelContent += "<>"; } excelContent += " <>"; for (int rowNo = 0; rowNo < dataset.Tables[0].Rows.Count; rowNo++) { excelContent += " <>"; for (int colNo = 0; colNo < dataset.Tables[0].Columns.Count; colNo++) { excelContent += "<>"; } excelContent += " <>"; } } else { excelContent += " <>"; for (int index = 0; index < dataset.Tables[0].Columns.Count; index++) { excelContent += "<>"; } excelContent += " <>"; } excelContent += "
";

excelContent += dataset.Tables[0].Columns[index].ColumnName;

excelContent += "
";

excelContent += dataset.Tables[0].Rows[rowNo][colNo].ToString();

excelContent += "
";

excelContent += dataset.Tables[0].Columns[index].ColumnName;

excelContent += "
";



attachment = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(excelContent));



return attachment;

}


for further information visit
http://www.scribd.com/groups/discussion/40777-how-to-convert-a-datset-to-excel-content-using-c-net

Tuesday, September 15, 2009

Free Website






For creating a website in just three steps at free of cost, visit http://thenewidentity.com/



Tuesday, August 25, 2009

Data Hiding

If a subclass is having a data member with same name as superclass data member then inside subclass, subclass data member hides superclass data member.
class Sample{
 int a = 5;
}
class SubSample extends Sample{
 int a = 6;
 void display(){
  System.out.println("\n a="+a);
 }
}
class InheritanaceDemo14{
 public static void main(String[] args){
   SubSample s = new SubSample();
   s.display();
   System.out.println("\n s.a="+s.a);
 }
}
output:
a = 6
s.a = 6
Explanation:

A super class object can refer its subclass object

class Sample{
}
class SubSample extends Sample{
}
class InheritanaceDemo8{
 public static void main(String[] args){
  Sample s1 = new Sample();
  Sample s2 = new SubSample();
  System.out.println("s1 = " + s1);
  System.out.println("s2 = " + s2);
 }
}
output:
s1 = Sample@010b30a7
s2 = SubSample@1a758cb

Explanation:

Saturday, August 22, 2009

Saddleback publishing Factoscope Ebooks - Rapidshare Link

Download Saddleback Factoscope e-books.





RapidShare Link downlaod