jump to navigation

Windows Phone Camp – Jeddah October 27, 2011

Posted by Bilal in Events, Jeddah.
Tags: , , , , , , , , , , ,
add a comment

This week, on 23rd of OCT Windows Phone Camp was conducted at Effat University. The event was sponsored by Telerik

The agenda of he event was as below:

8:30 AM Arrival and Registration
9:00 AM Welcome/ Windows Phone 7.5 Overview for Developers
9:45 AM Building Windows Phone Applications with Visual Studio 2010
10:45 AM Break
11:00 AM Building Windows Phone Apps with Silverlight
12:00 PM Lunch
12:45 PM Windows Phone Fast Application Switching, Tombstoning and Multitasking
1:45 PM Live Tiles and Push Notifications
2:45 PM Break
3:15 PM Monetizing a Windows Phone 7.5 Application
3:30 PM Build your app or work on a hands-on lab
5:00 PM What’s Next/Resources/Event End

The event was conducted by Microsoft Saudi Community. During this event, the very first community of Jeddah region was announced. If you are living in Jeddah and you are interested in Microsoft products and technologies, you are welcome to join though following social channels:

Some of the snaps of the event are shred here:

This slideshow requires JavaScript.

Jeddah Community Summit – May 2011 May 31, 2011

Posted by Bilal in Events, Jeddah.
Tags: , , , , , , , , , , , , ,
add a comment

Yesterday, on 30th May, Jeddah Community Summit was arranged by the Microsoft Saudi Community, the central hub of all the regional communities of the Kingdom. The purpose of these communities is to bring the people of a region closer, to share their experience, expertise and help other fellows of the same field in their work and knowledge gathering. These communities conduct sessions/workshops for a wide spectrum ranging from a single topic to multiple tools and topics for one workshop. These communities are very much active in other cities specially in Riyadh and Eastern Region. This event was arranged by the cooperation of the Effat University and Microsoft Saudi Arabia.

The introductory Session was conducted by Mr. Adel Al-Massarani, Developer & Platform Group Lead, Microsoft, KSA. He talked about DreamSpark, WebSiteSpark & BizSpark. He mentioned that how Microsoft provide software and hardware support for the early startup/students for first 3 Years. The provided software can be used freely after that period with some conditions. They provide a combination of free/subsidized licenses and Web Hosting. The business studies have shown that majority of IT based startups failed in first 2 years. The aim of these is to help companies to stand on Firm grounds. Currently, 45 startups have been approved in the Kingdom out of which 20 are active.

The next session by Fauzan Khan, a Microsoft Certified Trainer, was about the new and advanced features of Visual Studio 2010. He discussed about a lot of features including but not limited to:

  • Virtual Test Environment
  • Proactive Project Management
  • Architecture Validation
  • Dependency Validation
  • Code Analysis & Metrics
  • Intelli-Trace & Test Manager

All of these features are available in the Ultimate version of Visual Studio 2010. By using these tools we can clearly explain/understand the architecture of the application, validate the separation between different layers (data layer, business layer etc), trace out the bug by checking the variable values even in the deep nested calls, automate the advanced testing etc.

This was followed by the session about Windows Azure, also by Fauzan Khan. Windows Azure is the most latest, state of the art technology by Microsoft for cloud computing. With the combination of SQL Azure, it helps organization to dynamically, on the go, scale their infrastructure by cloud hosting. Instead of Software as a Service (SaaS) or Infrastructure as a Service (IaaS), it is a complete Platform as a Service (PaaS). It automatically manages a lot of things using Content Delivery Network (CDN), Traffic Managers etc with full support for customization. A complete list of Windows Azure features can be seen HERE. Azure Applications can easily be developed and tested in Visual Studio 2010 by downloading the Azure SDK. Recently, ebay, the world’s one of the most famous shopping site, has shifted to the Azure Platform.

It was followed by a light lunch and the prayer break. Refreshment was available all the time.

The next session about Building Windows Phone 7 Application was conducted by Adel Al-Zubeir, Sr. System Analyst and Windows Phone MVP. He demonstrated the currently and the recently added main features of Windows Phone. After that he described the complete development process of Windows Phone 7 application, starting with a simple Visual Studio project to a full fledge application working with web-services. Later, the publishing/marketing process was also described. Developers in ME (and some other regions with no direct access) can submit their apps to Windows MarketPlce with the help of Yalla Apps. Windows Phone Application can be developed in Visual Studio 2010 by downloading the developer tools. These applications are written in Silverlight. Any desktop application written in Silverlight can easily be transferred to Windows Phone. The current version of Windows Phone is Arabic enabled i.e. u can read the Arabic pages. Full Arabic support is expected in future. The switch by Nokia towards Windows Phone will help to reduce this time to market.

The last session was about the Microsoft Web Matrix. It is a collection of different tools (WordPress, Joomla, DotNetNuke etc) with easy/semi-automated installation process. It helps to create, customize and publish your website with a wizard based interface. It is mainly targeted towards the students.

In the last, there was a lucky draw for some books to be distributed among the attendee. Shirts with Microsoft branding were given to each attendant. The attendees were from different local companies. A few students were also present. The event ended at about 4 PM. We are thankful to Microsoft and Effat University for their support and co-operation, with a hope to have more session in the coming month with higher number of participants.


This slideshow requires JavaScript.

ASP.NET 4 Breaking Changes February 20, 2011

Posted by Bilal in .NET.
Tags: , , , , , , , , , , , ,
add a comment

The ASP.NET 4.0 has been a core update to ASP.NET 2.0. .NET 3.0 and .NET 3.5 were based on .NET 2.0 having additional assemblies only, not the core components. If you have installed all of these frameworks 2.0, 3.0, 3.5, 4.0 and you try to upgrade your ASP.NET 2.0 application, in IIS you will be able to find 2.0 and 4.0 version of the framework only.

Below is the list of the breaking changes in ASP.NET 4.0 that could affect your existing application while upgrading.

AutoCompleteCustomSource – Specified Cast is Not Valid January 3, 2011

Posted by Bilal in Programming.
Tags: , , , , , , , , , , , , , , , ,
2 comments

There was a requirement to implement a textbox with a databound AutoComple feature. As the Autocomplete source was a database, I have to go for a custom DataSource.

The main requirements for an auto-complete textbox (in this scenario) are:

  • AutoCompleteMode is set to Suggest(or SuggestAppend).
  • AutoCompleteSource is set to CustomSource
  • AutoCompleteCustomSource is set AutoCompleteStringCollection.

A sample code for this: (source)

namespace AutoCompleteTextBox
{
   public partial class frmAuto : Form
   {
      public string strConnection = 
             ConfigurationManager.AppSettings["ConnString"];
      AutoCompleteStringCollection namesCollection = 
             new AutoCompleteStringCollection();

      public frmAuto()
      {
         InitializeComponent();
      }

      private void frmAuto_Load(object sender, EventArgs e)
      {
         SqlDataReader dReader;
         SqlConnection conn = new SqlConnection();
         conn.ConnectionString = strConnection;
         SqlCommand cmd = new SqlCommand();
         cmd.Connection = conn;
         cmd.CommandType = CommandType.Text;
         cmd.CommandText = "Select distinct [Name] from [Names] order by [Name] asc";
         conn.Open();
         dReader = cmd.ExecuteReader();

         if (dReader.HasRows == true)
         {
            while (dReader.Read())
               namesCollection.Add(dReader["Name"].ToString());
         }
         else
         {
             MessageBox.Show("Data not found");
         }
         dReader.Close();

         txtName.AutoCompleteMode = AutoCompleteMode.Suggest;
         txtName.AutoCompleteSource = AutoCompleteSource.CustomSource;
         txtName.AutoCompleteCustomSource = namesCollection;
      }

      private void btnCancel_Click(object sender, EventArgs e)
      {
         Application.Exit();
      }
      private void btnOk_Click(object sender, EventArgs e)
      {
         MessageBox.Show("Hope you like this example");
      }
   }
}

I implemented the above properties and other related coding. The build was okay but when I executed the application, I got a Specified Cast is Not Valid exception.

I thought that I made some mistake while implementing, I revised the code and could not find anything wrong. The error was still there! I googled and came to know that I am not alone with this exception. I got a different implementation from MSDN for loading to the custom source.

AutoCompleteStringCollection source = new AutoCompleteStringCollection ();
source.AddRange(new string[]
   {
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December"
   });

// Create and initialize the text box
var textBox = new TextBox
{
   AutoCompleteCustomSource = source,
   AutoCompleteMode = AutoCompleteMode.SuggestAppend,
   AutoCompleteSource = AutoCompleteSource.CustomSource,
   Location = new Point(20, 20),
   Width = ClientRectangle.Width - 40,
   Visible = true
};

I created a String[] of the size of the DataTable row count and then added it to the AutoCompleteStringCollection object (similar to the above code). On executing the application, the result was same.

As I placed the code in the middle of my application, to avoid any confusion, I added a new windows form and updated my Program.cs to start from that form. On executing the application, the same error was there to greet me. I even tried to replace my DataBound source with the above static code, but no way. A simple thing that was supposed to be done in less than 30 min took hours of my time, still unsolved.

Since my Program.cs was having a lot of startup configurations and checks, for a final test I created a new WindowsFormApplication Project and used the MSDN code in the FormLoad event. On executing the application, surprisingly it executed normally giving the desired results. This was totally a wired situation. Most of the times, we are worried when something does not work properly BUT some other times, we are worried when some thing works. It was one of those rare cases.

Upon further googling, I came to know that it has surprisingly something to do with the STAThread attribute. In my application, I am having different forms being executed in different threads so I have removed the STAThread. It was not possible to apply the attribute in my application. It revealed that this thing has been reported to Microsoft as a BUG in Visual Studio 2005 in 2004 and separately 2007. If you happen to get the same scenario, please rate this issues and post your comments to ask Microsoft from wake up from a 7+ year long sleep.

To get the thing done, I have to go for the alternative solution. I replaced the TextBox with a ComboBox and set its DropDownStyle to DropDown. It was not EXACTLY same as the desired output but still usable.

Deploying .NET 4.0 Application on IIS 6.0 November 21, 2010

Posted by Bilal in Programming, Web.
Tags: , , , , , , , ,
5 comments

I had my ASP.NET 2.0 application hosted on Windows 2003 Sever with IIS 6.0. After Visual Studio 2010 or more precisely after .NET Framework 4.0, I upgraded the desktop modules to 4.0 (version 3.0 and 3.5 are superset, not the framework). The transition of desktop application from 2.0 to 4.0 was smooth enough. Although there were some deep level changes required in some scenarios (minor ones) but overall it was simple. The application executed properly in the first attempt.

I updated the Web Modules also but did not deploy them (in production environment only). Recently, it was planned to deploy the upgraded module. I installed the framework 4.0 on the web server and using the existing Publish settings, I published the upgraded application on the server (test server, not making experiments on the production server). On browsing the page, I got a 404 Page not found error. It was really a wired and unexpected situation. I have read about the issue of upgrading from IIS 6.0 to IIS 7.0 specially related to web.config but this transition error was totally not expected.

After a lot of search and attempts, I was able to execute the application. Below are the minimum steps required for it:

  1. In IIS 6 console, right click you project and click the properties and check the ASP.Net tab whether Framework 4 is selected or not. If not select the framework 4.
  2. In IIS 6 single application pool can’t be used for two different frameworks. Add a new pool with any meaningful name. Application Pools is above the Default
    Website node in the main tree hierarchy. (IIS 7 supports)
  3. To assign the application pool, in IIS console open the properties section of the web application, and click on the Home Directory tab and select newly created application pool from the drop-down-list.

Basically Page not found issue is cause of other problem which is set hidden by IIS6. But you need to see the real cause.

  1. For this open IIS6 console and in the main hierarchy, select Web Service Extension node which is right below the Default Website node. You will see the entire ASP.Net framework list over there, by default these frameworks might be set to Prohibited so select ASP.Net Framework 4 and click Allow button.

Browse you website now and it should be working.

If you are having some other errors, check the source link.

Microsoft OpenDoor Expo Jeddah 2010 November 13, 2010

Posted by Bilal in .NET, General, Microsoft, Tech News, Tips & Tricks, Updates, Windows.
Tags: , , , , , , , , , , , , , ,
1 comment so far

Microsoft OpenDoor 2010 Saudi Arabia took place in two cities Riyadh (2nd and 3rd Nov) and Jeddah (7th Nov) at Intercontinental Hotel. It was the first time that Microsoft CEO, Steve Ballmer visited KSA and delivered the Key Note but his visit was limited to one day and it was in Riyadh only.

The registration was web based and no registration fee was mentioned. I happen to know about Professional Developer Conference (PDC) that used to have separate registration fee for students and professionals. Anyhow, for this expo, a bar code was issued to each participant against his Windows Live ID.

The Expo started with the keynote of Developer & Platform group Manager
Adel Al-Massarani about Cloud Computing and Abdurrahman Al-Qahtani
Manager Windows Phone Group, about the new Windows Phone 7. It was followed by the presentation of the Platinum Sponsors

Mobily was also a platinum sponsor but they are already making too much advertisement through different mediums. No time was given to the Gold Sponsors. All of the sponsors have their stalls in the lobby where attendees can easily get their information.

After that there were three options to go:

  • Track A for IT Professional
  • Track B for Developers
  • Track C for Technical Managers

Each track was taking place in separate hall. Attendees had full choice to attend any of the tracks at any time as per their taste.

I joined the Track B (Developers). It started with a presentation of Mohamad Halbi about Windows Azure Platform, the cloud service operating system. It was a brief but comprehensive overview of the Azure Platform right from the start to a live working demo. He showed how windows Cloud could be utilized to get a cost effective and reliable performance.

It was followed by lunch and prayer break.

The next session was about Microsoft Web platform by Abdurrahman Al-Qahtani. He demonstrated about the new Web Platform and also gave some working demonstrations.

After a break of about 15 min, the stage was conquered by Jerry Yasir about the advanced features in Microsoft Excel 2010 and its interaction with Microsoft Sharepoint 2010. He showed how we can get the graphical representation of data and its distribution/sharing with other people through SharePoint.

Then there was prayer break. Refreshment was available in the side room that can be utilized by anybody at any time.

Last session of the track was about Visual Studio 2010 from Architecture Point of view by Abdurrahman Al-Qahtani. He should that how the advanced tools in VS 2010 can help in understanding/designing the architecture of a system graphically using UML.

In the last, there was a combined closing session of all the tracks in which winners were selected through a lucky draw. Gifts include 3 web-cameras and 1 XBOX 360 and another set of 2 web-cameras and 1 Xbox360 for the female participants.

And so, a wonderful Expo by Microsoft came to an end. We wish to see more such events in the near future by international companies like Microsoft, Google, Apple, etc… Also, we expect to see Steve Ballmer in Jeddah next year.

 

This slideshow requires JavaScript.

Some Visual Studio ShortCut Keys January 31, 2010

Posted by Bilal in .NET, Keyboard Shortcuts, Tips & Tricks, Visual Studio 2005, Visual Studio 2008.
Tags: , , ,
2 comments

Shortcut

Description

F3 Finds the next occurrence of the previous search text.
F5 Start debugging
F7 Jump to code behind file from .aspx files
F8 Moves the cursor to the next item, such as a task in the Task List window or a search match in the Find Results window. Each time you press F8, you move to the next item in the list.
F9 Toggle breakpoint
F12 Go to definition of identifier under cursor
Ctrl+F5 Start without debugging
Ctrl+F2 Jump to the Navigation Bar (hit TAB to get to the right side)
Ctrl+F3 Find word under cursor
Ctrl+TAB Toggle between windows in Visual Studio
Ctrl+I Incremental search (this is way better than Ctrl+F)
Ctrl+J Force IntelliSense for field members
Ctrl+C (with nothing selected) Copy whole line
Ctrl+Enter Open line above line cursor is on
Ctrl-X or Ctrl-L (with nothing selected) Cut whole line
Ctrl+] Bounce cursor between matching parentheses/brackets/braces
Ctrl+PageDown Toggle between Design and Source views in .aspx files
Alt+W, L Close all windows
Ctrl+K, Ctrl+C Comment out selection
Ctrl+K, Ctrl+U Uncomment selection
Ctrl+K, Ctrl+D Format document
Ctrl+K, Ctrl+X Insert snippet (or just type in the snippet name and hit TAB, TAB)
Ctrl+K, Ctrl+S Surround selected lines with snippet
Ctrl+K, Ctrl+K Toggle bookmark on/off
Ctrl+K, Ctrl+P Jump to previous bookmark
Ctrl+K, Ctrl+N Jump to next bookmark
Ctrl+M, Ctrl+M Open/close current fold
Ctrl+M, Ctrl+O Fold all methods
Ctrl+R, Ctrl+R Enables or disables word wrap in an editor.
Ctrl+Shift+B Build solution
Ctrl+Shift+C Displays the Class View window
Ctrl+Shift+Enter Open line below line cursor is on
Ctrl+Shift+F Global Search
Ctrl+Shift+F9 Delete all breakpoints
Ctrl+Alt+A Displays the Command window, which allows you to type commands that manipulate the IDE.
Ctrl+Alt+I Displays the Immediate window, where you can evaluate expressions and execute individual commands.
Ctrl+Alt+K Displays the Task List window where you customize, categorize and manage tasks, comments, shortcuts, warnings and error messages.
Ctrl+Alt+L Open the Solution Explorer (to find your file after you just closed them all)
Ctrl+Alt+T View Document Outline
Ctrl+Alt+0 Displays the Output window to view status messages at run time
Ctrl+Alt+R Open browser within VS.NET
Ctrl+Alt+U Displays the Modules window, which allows you to view the .dll or .exe files used by the program. In multiprocess debugging, you can right-click and select Show Modules for all Programs.
Ctrl+Alt+X Open Toolbox
Shift+Alt+Enter View editor in full screen mode

Source: http://virendrablogs.blogspot.com/2009/12/visual-studio-list-of-some-shortcut.html