This blog is subject the DISCLAIMER below.

Sunday, April 27, 2008

How to save image in SQL Server database?

Q: How to save image in SQL Server database?

A: It's the most common question asked in technical forums, the answer is so simply is to convert your image to binary and save the equivalent binary data to the database.

I am expecting you know how to Insert\get data to\from SQL Server.

To convert image to binary you need to write this piece of code

   1: System.IO.FileStream fs = new System.IO.FileStream(@"ImagePath", System.IO.FileMode.Open);
   2:             byte[] imageAsBytes = new byte[fs.Length];
   3:             fs.Read(imageAsBytes, 0, imageAsBytes.Length);
   4:             fs.Close();


You need a table with column of binary\image datatype to be able to insert the equivalent binary data of image.

And what about retrieving binary data to be converted to image

You just need to initiate new Image from MemoryStream object which takes array of bytes as an argument -Array of bytes comes from SQL Server-



1: Image img = Image.FromStream(new System.IO.MemoryStream(imageAsBytes));


.. more.

Friday, April 25, 2008

How to bind ComboBox to an array of object?

Q: How to bind ComboBox to an array of object?

A:

Assume we have class like Student class

   1: public class Student
   2:     {
   3:         int id;
   4:  
   5:         public int ID
   6:         {
   7:             get { return id; }
   8:             set { id = value; }
   9:         }
  10:         string firstName;
  11:  
  12:         public string FirstName
  13:         {
  14:             get { return firstName; }
  15:             set { firstName = value; }
  16:         }
  17:         string lastName;
  18:  
  19:         public string LastName
  20:         {
  21:             get { return lastName; }
  22:             set { lastName = value; }
  23:         }
  24:  
  25:         public string FullName
  26:         {
  27:             get { return firstName + " " + lastName; }
  28:         }
  29:  
  30:         public Student(int id, string firstName, string lastName)
  31:         {
  32:             this.id = id;
  33:             this.firstName = firstName;
  34:             this.lastName = lastName;
  35:         }
  36:     }



what we need is to bind an array of Student to ComboBox and let the ComboBox shows the student FullName and bind their IDs to be used later.



So, what we need is to use some ComboBox properties like DisplayMember and ValueMember




   1: Student[] students = new Student[3];
   2:  
   3:             students[0] = new Student(1, "Ramy", "Mahrous");
   4:             students[1] = new Student(2, "FCI", "Helwan");
   5:             students[2] = new Student(3, "X", "Y");
   6:  
   7:             comboBox1.Items.AddRange(students);
   8:             
   9:             comboBox1.DataSource = students;
  10:             comboBox1.ValueMember = "ID";
  11:             comboBox1.DisplayMember = "FullName";




And now, ComboBox shows the FullName without overriding ToString method which is not the solution if we need to bind some properties.



Untitled

.. more.

Wednesday, April 23, 2008

Ubuntu 8.04 will be released tomorrow

The official site of Ubuntu promise the next major LTS version will be 8.04 (Hardy Heron), scheduled for release on April 24 2008 (tomorrow) .

Ubuntu is a community developed, Linux-based operating system that is perfect for laptops, desktops and servers. It contains all the applications you need - a web browser, presentation, document and spreadsheet software, instant messaging and much more ...

Ubuntu's URL : http://www.ubuntu.com/

.. more.

Wednesday, April 16, 2008

Cosmos Operating System

Cosmos is an open source operating system project that aims to be completely implemented in CIL compliant languages, that is currently 100% C#. It signifies everything that is important in Operating Systems: Universalization, Security, and Simplicity.


Design Overview

  • Completely .NET based.
  • Microkernel or close hybrid
  • Configurable using modules
  • Cross platform architecture

User Kit

Build your own shell, build and deploy in 30 seconds or less! See for yourself. The basic steps are:

  1. Install Cosmos user kit
  2. File, New, Cosmos Boot project from within Visual Studio.
  3. Modify the entry point. The default project has just a WriteLine.
  4. Run (F5). Cosmos will now build a boot disk and ask you what emulator to use. Press 3 to use included QEMU, or choose from VMWare, Virtual PC, ISO, PXE and more!
That is all you need to do! User kit tutorial.

Video Demo

Source :- http://www.gocosmos.org/index.en.aspx
http://www.codeplex.com/Cosmos
http://www.facebook.com/pages/Cosmos-Operating-System/102358427

.. more.

Nokia Games Innovation Challenge

The competition aim to encourage new concepts in mobile gaming world ,advanced features and functionalities .This competition target all Nokia platform ( Nokia N-Gage, Java or Symbian-based Series 40 or S60 device).

There are three prizes for first three innovative concepts ,in addition to produce this concept on the corresponding Nokia platform.
The first winner will be awarded 40,000 Euros .
The second winner will be awarded 20,000 Euros.
The third winner will be awarded 10,000 Euros.

The competition is open to game designer and developer companies worldwide. NOT to individual persons, employees of the Organizer and affiliated companies of the Organizer .

the deadline for submitting on 20th of August and the announcement for the winners will be on 29 of October.

The details can be read from here :
http://www.gamingchallenge.org/main.php

.. more.

Microsoft Visual Studio Team System Code Name "Rosario"

Microsoft® Visual Studio® Team System code name “Rosario” is the version of Team System that follows Visual Studio Team System 2008. It is an integrated Application Life-cycle Management (ALM) solution comprising tools, processes, and guidance.

i heard in the last EDC - Egyptian developers conference- that Rosario will not be released with a new dotnet framework, it will work with dotnet framework 3.5 like VSTS2008.

Some of the major scenarios and features in this release will include:

  • Joint prioritization and management of IT projects through integration with Microsoft Project Server
  • Project management across multiple projects for proactively load balancing resources according to business priorities
  • Full traceability (inc. hierarchical work items) to track project deliverables against business requirements and the ability to conduct rapid impact analysis of proposed changes
  • Comprehensive metrics and dashboards for shared visibility into project status and progress against deliverables
  • Powerful new features to enable developers and testers to quickly identify, communicate, prioritize, diagnose and resolve bugs
  • Integrated test case management to create, organize and manage test cases across both the development and test teams
  • Testing automation and guidance to help developers and testers focus on business-level testing rather than repetitive, manual tasks
  • Quality metrics for a ‘go/no-go’ release decision on whether an application is ready for production and has been fully tested against business requirements
  • Rapid integration of remote, distributed, disconnected and outsourced teams into the development process
  • Easy customization of process and guidance from Microsoft and partners to match the way your team works
  • Integrated support to build setup packages using Windows Installer XML technology
  • Improvements to multi-server administration, build and source control.
Source :- http://msdn2.microsoft.com/en-us/vstudio/bb725993.aspx
for more information :- http://msdn2.microsoft.com/en-us/vstudio/bb936702.aspx

.. more.

Tuesday, April 15, 2008

FCI-H rocked ImagineCup competition


Yes, FCI-H rules; whenever we are; we have the big share, last Saturday 12April 2008 ImagineCup local finals held in Smart Village and 2 teams from Faculty of Computers and Information -Helwan University- have won, they catch the first and the third place, and the first will fly to France to represent Egypt not just their University and we all hope for them the big success.
The first place team:
Mahmoud Hassan
Ramy Essam
Ahmed Galal
Abd-ALLAH Haza'e
The Third place team:
Mona Rageb
Ahmed Gamal
Yassmin Abbas
Ahmed Shawe'y
Congratualtion and really thank you; we are proud of you.

.. more.

Sunday, April 13, 2008

UX REVEALED!


The event is mainly targeting designers and developers in Egypt, focusing on .NET developers to enrich the User Experience in their application and unveil the Usability to build a new Rich Internet Applications. Also empowers the Adobe Technology and increase the awareness between students and fresh graduates to give them a shed light on updated technology in the market.

To register: http://barmagy.com/adobe/default.aspx

.. more.

Friday, April 04, 2008

Vodafone Betavine Egypt competition


Welcome to the Vodafone Betavine Egypt competition!

Vodafone is offering all University students in Egypt the chance to win up to 5,000 euros, in its first mobile software development competition in Egypt. We believe students in Egypt have great innovation, resourcefulness and creativity, and we'd like to help you bring your ideas to life!If you've got what it takes to win the competition – hurry up, register now and make sure you tell all your friends who are also University students in Egypt.
Be sure to also read our Competition Guidelines for more information about how to enter competitions on Betavine.

The Brief
Develop an innovative mobile application based around one of the four concepts:
Social Networking and Communications
Information & Entertainment
Ofice & Business to Business
Social Impact

Description
The competition is deliberately left open and flexible in order to not inhibit the imagination and inventiveness of students. The application should be based around the four aforementioned areas.
Get started by following the Student Competition Guidelines 2008 instructions on How to enter a Student Competitions. The four areas that an application can compete in are described in more detail below:
Social Networking - Serving the needs of communities which share the same interests, providing a total communications experience E.g. at home, out and about, at play and at work.
Information and Entertainmnet - Serving the needs of people users encounter each day, getting news, local information, listen to their favourite music, TV, play games, at home or on the move.
Office and Business to Business - Serving the needs of companies and their employees, e.g. business travellers, sales people, payment systems.
Social Impact - Serving the needs of the big trends and challenges in future societies, e.g. healthcare, energy conservation, traffic control and logistics.

Read more on: http://betavine.net/web/guest/projects/students/egypt_competition

.. more.