10 Mart 2013 Pazar

"HTTP Error 500.19 - Internal Server Error" Hatası Çözümü








"HTTP Error 500.19 - Internal Server Error" Hatası İİS'deki ayarlardan kaynaklanıyor.Bende handlers sekmesinde hata vermiş.
Çözümü:
Başlat > Çalıştır "%windir%\system32\inetsrv\config\" yazıyoruz açılan dizinden,

 applicationHost.config dosyasını açıyoruz.
            <section name="handlers" overrideModeDefault="Deny" />














"Deny" yi "Allow" yapın.hatanız düzelecektir.



6 Mart 2013 Çarşamba

"At least one web, worker or virtual machine role is required but none could be found" Hatası Çözümü

Eğer mevcut web projenizi Azure projesi ile birleştirmek istiyorsanız "At least one web, worker or virtual machine role is required but none could be found " bu  hatayı alma ihtimaliniz yüksek.

Çözümü:
Hata açıklaması azure'da çalıştıracağım role yok ,rol eklemeniz gerekir diyor.
Azure Projesinde > Roles > Sağ Tık> Add > burada iki seçeneğimiz var, mevcut projeniz ekliyecek ise (Web Role Project in solution) seçiyoruz yeni web site oluşturacak isek (New Web Role Project) seçmeliyiz.

Biz "Web Role Project in solution" seçtikten sonra Aşağıdaki gibi  ekranda proje içerisine dahil ettiğimiz site'ler çıkar.Açılan pencereden web site projesini seçtikten sonra tamam diyoruz.



Ekledikten sonra aşağıdaki gibi Roles Klasörünün altına web projemizi atar.


Projeyi build ettiğimizde hatadan kurtulmuş olacaksınız.


Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive. Çözümü

Mevcut Web Sitenizi Azure projesine attığınızda eğer bu "Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case-sensitive." Hatayı veriyor ise,"obj" klasörünü projeden exclude edin yada o klasörü silerseniz hata vermeyecektir.

5 Mart 2013 Salı

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. Hatası

"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property." Hatasının çözümü:

Genelde Json'dan dönen değerin limiti ile ilgili bir hatadır.Default Değeri 4 MB olduğu için yukarıdaki hatayı verecektir,bu hatanın çözümü için web.config dosyamıza aşağıdaki kodu yazalım.

<configuration>
   
<system.web.extensions>
       
<scripting>
           
<webServices>
               
<jsonSerialization maxJsonLength="60000000"/>
           
</webServices>
       
</scripting>
   
</system.web.extensions>
</configuration>

Burada json'den dönen değerin uzunluğunu arttırmış olduk.

6 Şubat 2013 Çarşamba

Index’lerin fragmentation değerlerini öğrenmek

İndexlerimizin fragmentation yani bozulan oranları öğrenmek için aşağıdaki kodu T-sql'de çalışıyoruz.

Use ademcinar
GO
SELECT
      ps.object_id,
      i.name as IndexName,
      OBJECT_SCHEMA_NAME(ps.object_id) as ObjectSchemaName,
      OBJECT_NAME (ps.object_id) as ObjectName,
      ps.avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL , NULL, 'LIMITED') ps
INNER JOIN sys.indexes i ON i.object_id=ps.object_id and i.index_id=ps.index_id
WHERE avg_fragmentation_in_percent > 5 AND ps.index_id > 0
ORDER BY avg_fragmentation_in_percent desc




Çıkan sonuçta avg_fragmentation_in_percent değeri %30'dan büyük ise indexleri rebuild ile düzeltebiliriz.Eğer %30'dan küçük ise reorganize ile düzeltebiliriz.
Bir sonraki makalede indexrebuild ve reorganize işlemlerini anlatacağım


INSERT statement failed because data cannot be updated in a table with a columnstore index. Consider disabling the columnstore index before issuing the INSERT statement, then rebuilding the columnstore index after INSERT is complete

"INSERT statement failed because data cannot be updated in a table with a columnstore index. Consider disabling the columnstore index before issuing the INSERT statement, then rebuilding the columnstore index after INSERT is complete" Hata Çözümü

Bu Hata ColumStore İndex yapısını kullandığımız indexlerde karşımıza çıkar, sebebi ColumStore indexlerde insert,update ve delete işlemi yapmanıza izin vermez.insert yapıcağımızda ColumStore indeximizi disable yapıp insert yapabiliriz,insert işlemi bittikten sonra tekrar rebuild yapabiliriz. Aşağıdaki Örnekteki Gibi.

Çözümü ise;
--indexi disable ettik
alter index NCColumnStoreIndex-Test  on dbo.Kisiler disable
Go
-- kayıt ekledik
insert  dbo.Kisiler (ad,soyad) values('Adem','Çınar')
Go
--index tekrar aktif hale getirdik
alter index NCColumnStoreIndex-Test  on dbo.Kisiler rebuild
Go 

1 Şubat 2013 Cuma

Windows Phone İnternet Kontrolü

Windows Phone projelerimizde eğer İnternet üzerinden işlem yapacağımız zaman.İnternet kontrolünü mutlaka eklememiz gerek.Eklemediğimiz takdirde Store tarafından olumsuz yanıt alırız.
İnternet Kontrolü yapmak için aşağıdaki metodu ilk açılacak sayfamıza eklemeliyiz.

  if (!NetworkInterface.GetIsNetworkAvailable())
  {
   MessageBox.Show("İnternet Bağlantınızı Kontrol Ediniz...", "İnternet", MessageBoxButton.OK);
}

yukarıda GetIsNetworkAvailable metodunu çağırarak telefonda üzerinde İnternet olup olmadığını kontrol edip kullanıcıya uyarı verdik.