Tuesday, August 28, 2012

One Platform For Mobile Development (Adobe® PhoneGap™)

- Your Dream is to just write one code and it run over all mobile devices
- Then you need to use Phonegap

- Why use Phonegap ?

1- Cross Platform Mobile Development 
  • iPhone - iPad
  • Android
  • Blackberry 
  • Windows Phone 
  • Symbian
  • WebOS
  • Bada
2- Easy To use :
  • If you Know JavaScript , HTML5 And CSS then you can use  Phonegap

3- Enable you to reach native device functions 
  • like Camera , Geolocation , Contacts , File etc ...


4- Open Source Framework

5- By Adobe®

6- You don't need to hire all these people (Developers for every Platform)


7- Enjoy this videos 




naadydev@gmail.com
Mohamed ElNady

Sunday, July 29, 2012

Fix System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing database

When you restore your Database BackUp And get the the error :
System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing  database. (Microsoft.SqlServer.Smo)

Solution :
-- ==============================

RESTORE DATABASE MyAppDB
FROM DISK = 'D:\MyBusinessDB.bak'WITH REPLACE


-- =================================


naadydev@gmail.com

Sunday, July 8, 2012

Fix SharePoint Timer Jobs Running Multiple Times OR ( timer job executing twice )

publicoverride void Execute(Guid targetInstanceId)

{
    
SPWebApplication
webApplication = this.Parent as SPWebApplication;

SPWeb web = webApplication.Sites[0].RootWeb;
if (web.Site.ContentDatabase.Id.Equals(targetInstanceId))

{
// your Logic Here
}

     
}

----------- OR  --------

- In your Timer job constructor you will find one of the parameters is SPJobLockType Enumeration


- You should replace it with :  SPJobLockType.job





- SPJobLockType.ContentDatabase : Timer job runs one time for each content database associated with the Web application.

- SPJobLockType.job : Runs only on one machine in the farm.


http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spjoblocktype.aspx



naadydev@gmail.com



























Wednesday, July 4, 2012

Sharepoint Change Site Calendar type

using (SPSite oSiteCollection = new SPSite("http://localhost:2020"))
{
    using(SPWeb oWebsiteRoot = oSiteCollection.RootWeb)
    {
        SPRegionalSettings oRegionalSettings = oWebsiteRoot.RegionalSettings;
        oRegionalSettings.CalendarType = 6;  // Hijri Calendar
        oRegionalSettings.AdjustHijriDays = 2;

        oWebsiteRoot.Update();
    }
}

  CalendarType property  values:
  • 0 — None
  • 1 — Gregorian
  • 3 — Japanese Emperor Era
  • 5 — Korean Tangun Era
  • 6 — Hijri
  • 7 — Buddhist
  • 8 — Hebrew Lunar
  • 9 — Gregorian Middle East French Calendar
  • 10 — Gregorian Arabic Calendar
  • 11 — Gregorian Transliterated English Calendar
  • 12 — Gregorian Transliterated French Calendar
  • 16 — Saka Era


naadydev@gmail.com