jump to navigation

Cannot insert the value null into column ‘diagram_id’, table dbo.sysdiagrams December 28, 2011

Posted by Bilal in SQL Server 2005.
Tags: , , , , , ,
add a comment

When ever I copy the database from the production server to the development machine the database throws an error when updating a database diagram or creating a new database diagram. The error in question is

cannot-insert-the-value-null-into-column-diagram_id

The solution to this problem is rather simple go to dbo.sysdiagram table and set change the diagram_id default value to 0. However when you right click to bring up the design window for the dbo.sysdiagram table the option is disabled.
cannot-edit-table

Open up the columns and right click on the diagram_id column and select modify
edit_table

This loads the sysdiagram design window from where you can set the default value of the diagram_id field

setdefaultvalue

Save the changes and you will be able to update existing database diagrams and create new database diagrams.

Note this solution may not work for ever and has only been tested on sql server 2005.

Source: Link

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.

Windows8 KeyNote – Build Event September 14, 2011

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

Windows 7 is generally available for retail since 22nd October, 2009. Many things have been changed and many more have been arrived after that. The main focus from desktop has already shifted towards laptop/net-book. These days the trend has greatly diverted towards touch pads and slates.  The main pioneer was Apple’s iPad followed by similar products from Samsung, Asus, Motorola etc. Generally these pads uses iOS, WebOS or Andriod. There are some windows based (Windows 7) options available but they are more powerful and hence more expensive than others e.g. Asus Eee Slate.

build_logoMicrosoft has announced the Build Windows event to be conducted on 13-16 September 2011, to officially announce the next version of Windows i.e. Windows 8. To keep the local community up-to-date and introduce them to the latest development architecture & tools, Microsoft Saudi Community arranged the live webcast of the keynotes in 3 cities of the Kingdom: Riyadh, Jeddah and Al-Khobar. The tag line for new Windows 8 is:

In 1995, Windows changed PC. BUILD will show you that Windows 8 changes everything

In Jeddah, the event was planned at Dar Al-Hekma College. The keynote was supposed to start at 7 PM (Makkah Time). As per the agenda, the registration was planned to start at 5:30. A welcome note was given by Mr. Adel Al-Massarani, The Developer & Platform Group Lead, Microsoft, KSA. He explained about the technical communities and user groups operating in the Kingdom. He mentioned that Microsoft Arabia is interested in improving its collaboration with the technical community of Western Region. Microsoft is also planning to increase the frequency of the Sponsored Programs and events to help the users to adopt the new technologies.

It was followed by a short refreshment and prayer break.

The keynote was kicked off by Steven Sinofsky, president of Microsoft’s Windows Division, in a some-how Steve Job inspired style. He explained the new and cool features of Windows 8. Contrary to  previous pattern of Microsoft, Windows 8 does not have any new hardware requirements, any PC that is fulfilling the requirements of Windows 7 is fully acceptable for Windows 8. The main trend building thing in Windows8 is the Metro style UI. Along with the traditional mouse based approach, this Metro style is Touch Oriented. In previous years, Office 2007 introduced a new ribbon based look and feel. Although it was taken as a new standard by many other applications (web  applications as well) but it was not ported to Windows itself. But in case of Windows8, this metro style is highly dominant and the next release of Office is also expected to adopt it. Microsoft has been wise enough to provide simple and easy upgrade of classic applications to Metro style with minimum code.

During the keynote a lot of features + updates were described ranging from a daily user’s interest to the developers extent. This post is not intended to explain the keynotes in details. Below is JUST the list of some of the noticeable features:

  • Extremely fast start up (8 sec in the demo)
  • Infected USB boot protection
  • Picture Password for Login
  • ARM based architecture now supported
  • Support for a wide range of programming languages, ranging from Win32 API, C++, VB, C# and even Javascript.
  • Spell Checker available throughout the System
  • User Profile Sync across multiple machines (based on Live Id)
  • Javascript based templates for application development in Visual Studio
  • Microsoft Application Store linked with Visual Studio with Live status display of the application
  • New low power state: Connected Standby
  • Support up to 256 TB of hard disk
  • Simple Refresh or Reset to factory setting feature
  • Improved file copy with visual progress and better speed
  • Fully loaded Control Panel and Task Manager
  • Up Button is finally back in the Windows explorer with a new bar similar to Office Quick Launch bar
  • Built in support for multiple monitors, ISO mounting and burning etc.
  • Touch Enabled Internet Explorer 10 with extreme hardware acceleration
  • Option to switch between Metro and classic Desktop style
  • Browse SkyDrivesimilar to a native folder
  • Tap to share available for NFC for supported hardware
  • Different keyboards with emotions natively available. Split keyboard also available for thumb typing

Towards the end of the presentation, it was announced that 5000 Intel i5 based, 11 ” tablets made by Samsung will be given to the audience. This tablet, called Developer PC, is preloaded with Windows8 and other required tools for developing and debugging applications.

The keynote session last for about 2 and a half hour.  It seems that Microsoft is planning to go far ahead with its new Metro styles Windows with full support for desktop machines up to the new touch centric tablets with extra slim sizes and increasing processing power. We can clearly expect to see Windows based tablets available for general users in the 1st half of 2012.

One more good thing is Windows8 can easily be downloaded (legally) from the following link:

http://dev.windows.com

The local attendees of the webcast were given a short survey by Microsoft Arabia to know about their interest which will help in understanding the needs and requirement of local market.

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.

The new, Firefox 4 March 23, 2011

Posted by Bilal in Uncategorized.
add a comment

Firefox 4

[Click the image for High Resolution]

 

 

Download the New Firefox Now

Spread Firefox Affiliate Button

 

 

Portable Battery for iPhone March 1, 2011

Posted by Bilal in iPhone, Product.
Tags: , , , , , ,
add a comment

By now, the tethered JailBreak for 4.2.1 is available. It took a long time for this version as compared to previous versions in the near past.

In the early days of 4.2.1, I had 4.0.1 (jailbreaked) that was corrupted due to some junk installations. In normal circumstances, I would have waited for the stable un-tethered JB for 4.2.1 but at that time, I had to. I upgraded to 4.2.1 and tried to ‘survive’ without JB. I could not drag it for more than 2 days and on 3rd day, using LimeRain I jailbreaked it, although tethered.

I am having one charging cable in office and the other one I have in my car, all the time. It’s suitable for normal conditions but when you r having a Tethered JailBreaked device, you have to be more cautious.
I tried to look for any external battery available locally in the famous stores like iTechia, iWeaver, iZone, RadioShack but no one have it either in the stock or in the product list. Some I visited personally and some other I checked through website or phone. It was just by chance, that I happen to go to eXtra store with my friend who was looking for some laptop, I usually don’t go to eXtra (due to some reasons). To my utmost surprise, not only there was an external battery but also another model with solar charging. Since it was my first purchase from eXtra, I don’t want to get a crap product and waste my money. I noted the details and after checking it on the web, I purchased it on next day.

Since then, I have been randomly using it. It is giving more than 50% of battery when fully charged with the LED indicator of remaining battery.

The product home page can be accessed here but more details can be found here. If you want to know the price in SR, check this link. To get the actual price, dont forget to include the shipping.

Hellooo!

kool down, I got from eXtra, not from Globalmediapro, i got it for a fair price of 89 SR only. The other model with solar cells was available for 10 SR extra i.e. 99 SR. Solar Cells are quite sensitive and require care, so i skipped that one. It is more suitable for the people planning for desert trip.. Sorry, I don’t have its picture. If you happen to get it, do share it with me.

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: , , , , , , , , , , , , , , , ,
1 comment so far

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: , , , , , , , ,
2 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.

Follow

Get every new post delivered to your Inbox.

Join 68 other followers