Google Analytics İzleme

02 Eylül 2009

Toshiba laptoplarda kurtarma bölümünü çalıştırma hangi tuşla oluyor?

Tohiba laptobı yeniden kurma ihtiyacım oldu. Bunun için kurtarma bölümünden yüklemek istedim. Fakat buraya nasıl erişilip çalıştırılacak. İnternette yaptığım gogıling sonucunda F1, F12, 0 veya C harfine sürekli basınca ulaşabilceğime dair bilgiler edindim. Yaptığım denemelerde C harfine bilgisayar daha en başından açılırken basılı tutunca işe yaradığını gördüm. Diğerleri işe yaramadı, sanırım model farklılığından olmadı.

Kurtarma bölümüne(Recovery partition) erişmek için bilgisayar açılırken sürekli C harfine basılı tutunuz.

İnternet Explorer 7 ( ie 7 ) 'de TreeView'in dikey çizgileri kırık kırık göüzkme problemi

TreeView'in html çıktısında div etiketinin boyutu 1 px olduğu için hatalı gösterilmektedir.
Bu div'in yüksekliğin 100% veya 20px olarak belirtirseniz probleminiz çözülecek.

And now, here is how we can sort this out:

  • Create a new style definition in your page (or create an external .css file and link it in your pages, pedending on your needs)
  • Add the following class definition: ".tree td div {height: 20px !important}" (of course without quotation marks)
  • In your TreeView component add a referende to CssClass="tree"
kaynak:
http://blogs.msdn.com/carloc/archive/2007/05/23/broken-line-in-asp-net-2-0-treeview-in-ie-7.aspx

24 Ağustos 2009

Asp.Net'de oturum açan NT kullanıcı adını tespit etme

Getting the User Name :

using three ways we can get the User Name using C#

1) System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;

string strName = p.Identity.Name;

[ OR ]

2) string strName = HttpContext.Current.User.Identity.Name.ToString();

[ OR ]

3) string strName = Request.ServerVariables["AUTH_USER"]; //Finding with name

string strName = Request.ServerVariables[5]; //Finding with index

In Above 3 Cases returnin string contains DomainName\WinNTLoggedUserName

(for Ex: Microsoft\Bill.Gates. Here Microsoft is domain Bill.Gates is Logger User Name )

Using string operations seperate the DomainName and UserName.

kaynak:

http://www.codeproject.com/KB/aspnet/How_to_NT_User_Name.aspx


21 Ağustos 2009

Stop running this script? A Script on this page is causing Internet Explorer to run slowly

Aşağıdaki uyarıyı internet explorer'da bir web sayfasında alıyorsanız:
Stop running this script? A Script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Yes / No"

Kütükten çalıştırılacak javascript ifadesinin sayısını yüksek verebilirsiniz. varsayılan olarak 5,000,000' dır.

Do this:

1. Using a Registry Editor such as Regedt32.exe, open this key:
HKEY_CURRENT_USER\Software\Microsoft\InternetExplo rer\Styles

Note If the Styles key is not present, create a new key that is called Styles.
2. Create a new DWORD value called "MaxScriptStatements" under this key and set the value to the desired number of script statements.

HOWEVER whats different is this:

Set the "MaxScriptStatements" Value to DECIMAL, then type 0 to Disable the damn box, Voila! no more "script is taking for too long" box.


kaynak:

How to set time-out period for script: http://support.microsoft.com/kb/175500

http://forums.asp.net/p/1297674/2523672.aspx
http://www.askmehelpdesk.com/internet-web/internet-explorer-stop-running-script-73040.html

ORA-01795: bir listedeki ifadelerin maksimum sayısı 1000'dir

Aşağıdaki hatayı alıyorsanız:
ORA-01795: bir listedeki ifadelerin maksimum sayısı 1000'dir
ORA-01795 Maximum number of expressions in a list is 1000.

Şu adımları uygulayabilirsiniz:
---------------------------------

maximum number of expressions in a list is 1000

Cause: More than 254 columns or expressions were specified in a list.

Action: Remove some of the expressions from the list.

----------------------------------

the problem is purely related to oracle limitations.

One possible workaround would be to split the IN clause in several parts with less than 1000 elements
and concatenate the new IN clauses with OR:

like : SELECT * FROM TableX where (TableX.column IN (?, ..., '<=1000 ?' ) OR TableX.column IN (?, ..., '<=1000 ?' ) OR ...)


------------------------------------

There is a miximum number of elements allowed in an IN list and it is 1000. Go beyond this and you get this error. I suspect toad has generated a query that exceeds this limit.

The two most common approaches to getting around this are:

1) split the workload up such that you never generate more than 1000 items in an IN list (this was suggested already)

2) join to a table that contain the list of values you want. There is no limit with this method as it is a simple join.

Good luck, Kevin

------------------------------------------

-- Instead of having:
s.userId IN (:users)
-- We will have:
(
s.userId IN (:users0) OR
s.userId IN (:users1) OR
... OR
s.userId IN (:usersN)
)

-------------------------

Kaynak:
http://codingwithcoffee.com/?p=121
http://jira.springframework.org/browse/SPR-3396
http://ordba.blogspot.com/

08 Temmuz 2009

An error occurred when trying to convert the byte array ... of RFCTYPE RFCTYPE_DATE with length 8 and decimals 0 to XML format hatası çözümü

.Net'te SAP'ye WCF tabanlı erişim yaparken Biztalk Adapter Pack V1.0 kullanıyorsanız SAP DATS veritiplerinden .NET DateTime tipine dönüştürme esnasında hatalar oluşabilmektedir. Bu hatalar genelde SAP'den gelen DATS tipindeki datanın null, 00000000, 99999999 gibi min,max değerleri, uygun olmayan tarih biçinde dönüş olduğunda .NET tarafında dönüştürme olduğunda hataya neden olmaktadır. Bu problem için Microsoft, Adapter Pack V1.0 için yama yayınladı ve bu hatalar için parametresel değer atayarak aşılması sağlandı.

Yama indirme : http://support.microsoft.com/kb/954539/en-us

kaynak:
http://biztalkia.com/blogs/ninocrudele/archive/2009/02/12/wcf-sap-error.aspx
http://social.msdn.microsoft.com/Forums/en-US/biztalkr2adapters/thread/b2b2450a-c5dd-471f-87ff-fb686e4a06c2
The “DataTypesBehavior” binding property in the SAP Adapter: http://blogs.msdn.com/adapters/archive/2008/08/13/the-datatypesbehavior-binding-property-in-the-sap-adapter.aspx

.Net'te SAP RFC'ye erişmek için kullanılan WCF tabanlı erişimde VS 2008'in sapBinding parametresini tanınmaması

Invalid binding warning when using the adapter in Visual Studio 2008

Problem

When you use the adapter to create an application in Visual Studio 2008 and you open the configuration file (app.config) generated by the adapter, you see a warning similar to the following:

The element 'bindings' has invalid child element 'sapBinding'. List of possible elements expected: 'basicHttpBinding, customBinding, ...

Cause

This warning appears because the SAP adapter binding, sapBinding, is not a standard binding shipped with the Windows Communication Foundation (WCF).

Resolution

You can safely ignore this warning.

kaynak:
http://msdn.microsoft.com/en-us/library/dd788590.aspx

.Net'ten SAP RFC çağırırken MaxItemsInObjectGraph değerini artırma

RFC metodundan dönen veriler çok fazla ise aşağıdaki hatayı verecektir:

Maximum number of items that can be serialized or deserialized in an object graph is '65536'.
Change the object graph or increase the MaxItemsInObjectGraph quota.

Bu değeri artırmak için :

Error while retrieving XML with more than 65,536 nodes

Problem

The adapter gives the following error while retrieving XML output that has more than 65,536 nodes.

Maximum number of items that can be serialized or deserialized in an object graph is '65536'.
Change the object graph or increase the MaxItemsInObjectGraph quota.

Cause

The adapter cannot serialize and deserialize an object with more than 65,536 items.

Resolution

You can fix this issue by setting the maxItemsInObjectGraph parameter in either of the following two ways:

  • Set this parameter by changing the maxItemsInObjectGraph parameter in the ServiceBehavior attribute on your service class.

  • Add the following to your application's app.config file.







A sample app.config will look like the following.












contract="IOutboundContract" name="sap_ICalculator" />



Kaynak:
http://msdn.microsoft.com/en-us/library/dd788590.aspx

01 Temmuz 2009

AJAX ve Güvenlik Sorunları

XSS'i engellemek, yani kullanıcıların web sitenize gönderdiği içeriği filtrelemek için Microsoft tarafından ASP.NET geliştiricileri için hazırlanmış olan Anti-Cross Site Script kütüphanesini kullanabilirsiniz.

Kaynak:
http://daron.yondem.com/tr/PermaLink.aspx?guid=4ca7f74e-dcc3-4f5e-8b97-3b84d6ca2d44

30 Haziran 2009

C#: How to sort list of objects by multiple columns

Kaynak:
http://tgynther.blogspot.com/2008/10/c-how-to-sort-list-of-objects-by.html

http://69.10.233.10/KB/recipes/Sorting_with_Objects.aspx

AJAX kullandıgınız bir ASP.NET uygulamasında JS ile yeni pencere açmak

Sanırım ASP.Net de Response.Redirect kullanarak yeni bir pencere açtırmanın bir yolunun olmadıgını biliyorsunuz. Eger bir event gerçekleştiginde yeni bir sayfa açmak ama bunu _blank yani yeni bir pencerede açtırmak istiyorsanız, sanki popup gibi, bir tek yolunuz var oda JScript kullanmak.

Herhangi bir anda JS ile window.open kullanarak yeni pencere acacaksanız C# da şunu kullanmalısınız :

string jskodumuz= @"";

ClientScript.RegisterStartupScript(GetType(),"YeniPencere",jskodumuz);

Ama eger AJAX kullanıyorsanız UpdatePanel buna izin vermeyecektir, siz o zaman bu kodu kullanıyorsunuz:

ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, typeof(string), "yeniac", "window.open(\"kkformu.aspx\",null,\"height=900,
width=700,status=yes,toolbar=no,menubar=no,location=no\");" , true);


Kaynak:

http://www.celiker.com/post/2007/09/15/AJAX-kullandc4b1gc4b1nc4b1z-bir-ASPNET-uygulamasc4b1nda-JS-ile-yeni-pencere-acmak.aspx


Modal pop up with in update panel : http://www.codeasp.net/blogs/vinay_jss/microsoft-net/118/modal-pop-up-with-in-update-panel

Visual Studio 2008 ve ASP.NET 2.0 AJAX Extensions 1.0 kullanımı

Visual Studio 2008 ve ASP.NET3.5 ile beraber AJAX Extensions'ın artık dahili olduğundan daha önceki yazılarımda bahsetmiştim. Diğer yandan Visual Studio 2008'in Multi-Targeting özelliği sayesinde ASP.NET 2.0 sitelerini de Visual Studio 2008 içerisinde hazırlama şansımız var. Tüm bunları yan yana koyduğumuzda akla şu soru geliyor "ASP.NET 2.0 ile AJAX Extension kullanacağımız bir site yaratabilir miyiz?" Eskiden Visual Studio 2005 ile yarattığınız AJAX Enabled Web Site'ları Visual Studio 2008 ile açarak düzenleyebiliyorsunuz fakat maalesef Visual Studio 2008 içerisinde .NET Framework 2.0 ile beraber ASP.NET 2.0 ile AJAX Extensions 1.0 destekli siteler yaratmak için gerekli proje şablonları gelmiyor.

O nedenle yukarıda bahsettiğim özelliği Visual Studio 2008'e entegre etmek amacıyla ASP.NET 2.0 AJAX Exntensions proje şablonlarının yükleme paketi ayrı olarak Microsoft tarafından duyuruldu. Hemen aşağıdaki adresten indirerek bilgisayarınıza yükleyebilirsiniz. Tabi bunun öncesinde bilgisayarınızda Visual Studio 2008 ve AJAX Extensions 1.0 sürümünün yüklü olduğunu varsayıyorum.

http://www.microsoft.com/downloads/details.aspx?FamilyID=5c7df430-1c34-40d2-b6ec-81353b5fcf2e&displaylang=en

Yüklemeyi tamamladıktan sonra Visual Studio 2008 içerisinde .NET Framework 2.0'ı seçtiğinizde aşağıdaki şekilde proje şablonları arasında "AJAX 1.0-Enabled ASP.NET 2.0 Web Site" da seçebileceksiniz.

Kaynak:
http://daron.yondem.com/tr/PermaLink.aspx?guid=ec34028c-d7ea-4c8d-83e6-23546676b17d


26 Haziran 2009

Javascript kütüphane karşılaştırması, asp.net geliştiricileri için

kaynak:
JavaScript frameworks comparison table: http://blogs.southworks.net/jdominguez/2008/01/javascript-frameworks-comparison-table/

Some weeks ago we did a quick research about the different JavaScript frameworks/libraries out there. We didn’t take into account every framework on the web, and chose especially those that can integrate easily with ASP.NET WebForms.

I’d thought I’d share the results with the community in the form of a comparison table. You can use the results as you wish, but I warn you this is by no means exhaustive.

List of frameworks/libraries we considered

21 Haziran 2009

Ado.Net 2.0 Transaction kullanımı


Kaynaklar:
Ado.Net 2.0' da Transaction Kavramı: http://www.csharpnedir.com/makalegoster.asp?MId=487
Implementing TransactionScope Using .Net 2.0: http://www.codeproject.com/KB/dotnet/TransactionScope20.aspx

TransactionScope kullanırken timeout(zamanaşımı) hatasının çözümü

transaction çalışmasının .net'de varsayılan zaman aşımı süresi 60 saniye'dir. Eğer sql işlemleriniz fazla zaman alıyorsa bu süreyi artırmamız gerekmektedir. Bunun için iki yöntem vardır. Ya transactionscope nesnesini oluştururken timespan parametresini vermektir veya web.config içinden düzenlemektir.

We can also define the timeout in the application configuration (web.config or app.config) as shown

We need to define the max timeout setting at machine level in machine.config



Buralarda kullanılan timeout= saat:dakika:saniye şeklinde atanmaktadır.

Kaynaklar:

Transaction Timeout in System.Transactions: http://sankarsan.wordpress.com/2009/02/01/transaction-timeout-in-systemtransactions/

Transaction timeout: http://aselai.blogspot.com/2008/09/transactionscope-timeout.html

TransactionScope Timeout: http://codemetropolis.com/archive/2008/06/14/transactionscope-timeout.aspx

http://www.dotnetkicks.com/adonet/TransactionScope_timeout