Official Google Blog: Practical steps towards a greener, energy-efficien...: "(Cross-posted from the European Public Policy Blog ) Update June 14, 9:14am: Videos of all the presentations at the Data Center Summit are now available on our website.
Data centers are very important to us—they’re critical to the cloud services we deliver. Over the last 12 years, we’ve put a lot of effort into minimizing the amount of energy, water and other resources we use—because it makes financial sense, and because it’s good for the environment too. That work means that today, we use half the energy of a typical industry data center. ..."
Here Google talks about the data-centers and how to work and operate them efficiently, thus saving electricity and making data-centers environment friendly. A must read.
Topics covering basic to advanced concepts of Asp.Net, C#.Net and Sql-Server Database.
Wednesday, June 15, 2011
Friday, June 10, 2011
Apple iCloud - Cloud Computing in Action
Now Apple too is on the Cloud ! Apple has launched its own Cloud Computing offering - iCloud. It is a set of cloud services that work seamlessly with applications on your iPad, iPhone, iPod touch, Mac, or PC to automatically and wirelessly store your content and push it to all your devices. And the great news is that it is FREE. iCloud services include new versions of Contact, Calendar, and Mail; iCloud Backup and Storage; Photo Stream; and iTunes in the Cloud. And for just $24.99 a year, iTunes Match will give you all of the benefits of iTunes in the Cloud for music you haven’t purchased from iTunes.
For more on it read at official iCloud site.
For more on it read at official iCloud site.
Labels:
Apple,
Cloud Computing
Wednesday, June 8, 2011
Serialization in .Net
Many times we are faced with the situation where we need to save records in different tables and these are inter-linked and having a relationship. Now the problem is how to send these records from application to database and then save them maintaining their relationships intact. Further all this should be fail proof so that if any error is encountered in the whole operation then all is rolled back. In this post I am going to discuss about how to handle this situation by an example. The key points that I am going to touch is Serialization and XML.
For example we have a application where we are registering a student. For this we are saving the basic information of the student, the subjects that he has chosen. Thus the outline of the student registration data would be as follows:
Student
--BasicInfo
--RollNo
--Name
--Age
--Address
--Class
--Gender
--Subject
--SubjectId
--SubjectName
Now the number of records in Subject for a student can be more then one i.e. for a single BasicInfo record of a student there can be multiple Subject records i.e. a one to many relationship. The entity for Student will be as follows:
Here to maintain the relationships of one to many I have used List collection for subjects. This collection would contain all the subjects that the student chooses. We fill the entity as follows:
Now to convert this into XML we would serialize the Student object. The code for it is as follows:
The XML generated for it is as follows:

Thus we have generated the XML of the Student entity class using serialization and we have also maintained the one to many relationship between the StudentInfo and Subjects. In the next post I will discuss how to use this consume this XML in sql server and save the data in the tables.
For example we have a application where we are registering a student. For this we are saving the basic information of the student, the subjects that he has chosen. Thus the outline of the student registration data would be as follows:
Student
--BasicInfo
--RollNo
--Name
--Age
--Address
--Class
--Gender
--Subject
--SubjectId
--SubjectName
Now the number of records in Subject for a student can be more then one i.e. for a single BasicInfo record of a student there can be multiple Subject records i.e. a one to many relationship. The entity for Student will be as follows:
public class Student
{
public int RollNo { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public string Address { get; set; }
public int Class { get; set; }
public bool Gender { get; set; }
public List<Subjects> ListSubject { get; set; }
}
public class Subjects
{
public Subjects(int subjectId, string subjectName)
{
SubjectId = subjectId;
SubjectName = subjectName;
}
public int SubjectId { get; set; }
public string SubjectName { get; set; }
}
Here to maintain the relationships of one to many I have used List collection for subjects. This collection would contain all the subjects that the student chooses. We fill the entity as follows:
Student obj = new Student();
obj.Name = "Jai";
obj.RollNo = 100;
obj.Age = 27;
obj.Class = 10;
obj.Gender = true;
obj.Address = "New Delhi, India";
obj.ListSubject = new List<Subjects>();
obj.ListSubject.Add(new Subjects(1, "English"));
obj.ListSubject.Add(new Subjects(2, "Maths"));
obj.ListSubject.Add(new Subjects(3, "Physics"));
obj.ListSubject.Add(new Subjects(4, "Computers"));
Now to convert this into XML we would serialize the Student object. The code for it is as follows:
StringBuilder builder = new StringBuilder();
System.Xml.Serialization.XmlSerializer x =
new System.Xml.Serialization.XmlSerializer(obj.GetType());
using (StringWriter writer = new StringWriter(builder))
{
x.Serialize(writer, obj);
}
string myXml = builder.ToString();
The XML generated for it is as follows:

Thus we have generated the XML of the Student entity class using serialization and we have also maintained the one to many relationship between the StudentInfo and Subjects. In the next post I will discuss how to use this consume this XML in sql server and save the data in the tables.
Labels:
.net,
c#.net,
serialization,
xml
Subscribe to:
Posts (Atom)
