31 Aralık 2015 Perşembe

Error in File C:\Windows\TEMP\ Hatası

Server Error in '/' Application.

Error in File C:\Windows\TEMP\ Reports {C754ADDD-2D12-4011-B425-3DF796FA831F}.rpt:
Operation not yet implemented.

 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Error in File C:\Windows\TEMP\RptMasrafListesi {C754ADDD-2D12-4011-B425-3DF796FA831F}.rpt:
Operation not yet implemented.

Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



Aslında çözümü çok kolay
Aşağıdaki güncellemeyi silmek sorunu kökten çözüyor :))

There is one more solution for this problem.
Uninstall Update for Microsoft Windows(KB3102429)
Control Panel –> Program & Features –> View installed updates and Search for KB3102429, right click and uninstall.
This solved my issue.

10 Aralık 2015 Perşembe

Files has invalid value "<<<<<<< .mine". Illegal characters in path.

Files has invalid value "<<<<<<< .mine". Illegal characters in path.  
Visual Studio ve Svn kullanıyorsanız yukarıdaki hata ile karşılaşabilirsiniz. Ama çözümü basit tabiki

işte çözüm;

Proje içindeki “Obj” klasörünü silin ve Rebuild yapın. işte bukadar :)

Delete the /obj folder in each project that is complaining and re-compile. 

4 Aralık 2015 Cuma

IDENTITY_INSERT is set to OFF


Cannot insert explicit value for identity column in table 'Stok_tmp' when IDENTITY_INSERT is set to OFF.


Sqlde yukarıdaki hata ile karşılaşırsanız çözümü ya IDENTITY olarak verdiğiniz alanı sql cümlenizde insert etmemelisiniz veya ağaşıdaki kod ile IDENTITY alana ekleme yapmanızı sağlayabilirsiniz.

SET IDENTITY_INSERT tablo_adı OFF

9 Eylül 2015 Çarşamba

Sql Üzerindeki Kullanıcı Connection Sayılarını göstermek

MsSql üzerinde açık olan kullanıcı ve Connection Sayılarını göstermek için aşağıdaki kodu 
kullanabilirsiniz.

SELECT DB_NAME(dbid) as DBName, COUNT(dbid) as NumberOfConnections, loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0GROUP BY dbid, loginame

19 Ağustos 2015 Çarşamba

SQL Server database restore error: specified cast is not valid. (SqlManagerUI)

Error: Specified cast is not valid. (SqlManagerUI)

hatası alıyorsanız TSQL ile backuptan dönebilirsiniz...


RESTORE DB_NAME 
FROM  DISK = N'C:\BACKUP.bak' 
GO
RESTORE DATABASE DB_NAME 
FROM DISK = 'C:\BACKUP.bak'WITH 
   MOVE 'DB_NAME' TO 'C:\DATA\DB_NAME.mdf',    MOVE 'DB_NAME_log' TO 'C:\DATA\DB_NAME.ldf', REPLACE
GO  

12 Ağustos 2015 Çarşamba

String.Format ile Formatlı Yazdırma...

String Format for Double [C#]

The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString and float.ToString.

Digits after decimal point

This example formats double to string with fixed number of decimal places. For two decimal places use pattern „0.00“. If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded.
[C#]
// just two decimal places
String.Format("{0:0.00}", 123.4567);      // "123.46"
String.Format("{0:0.00}", 123.4);         // "123.40"
String.Format("{0:0.00}", 123.0);         // "123.00"

Next example formats double to string with floating number of decimal places. E.g. for maximal two decimal places use pattern „0.##“.
[C#]
// max. two decimal places
String.Format("{0:0.##}", 123.4567);      // "123.46"
String.Format("{0:0.##}", 123.4);         // "123.4"
String.Format("{0:0.##}", 123.0);         // "123"

Digits before decimal point

If you want a float number to have any minimal number of digits before decimal point use N-times zero before decimal point. E.g. pattern „00.0“ formats a float number to string with at least two digits before decimal point and one digit after that.
[C#]
// at least two digits before decimal point
String.Format("{0:00.0}", 123.4567);      // "123.5"
String.Format("{0:00.0}", 23.4567);       // "23.5"
String.Format("{0:00.0}", 3.4567);        // "03.5"
String.Format("{0:00.0}", -3.4567);       // "-03.5"

Thousands separator

To format double to string with use of thousands separator use zero and comma separator before an usual float formatting pattern, e.g. pattern „0,0.0“ formats the number to use thousands separators and to have one decimal place.
[C#]
String.Format("{0:0,0.0}", 12345.67);     // "12,345.7"
String.Format("{0:0,0}", 12345.67);       // "12,346"

Zero

Float numbers between zero and one can be formatted in two ways, with or without leading zero before decimal point. To format number without a leading zero use # before point. For example „#.0“ formats number to have one decimal place and zero to N digits before decimal point (e.g. „.5“ or „123.5“).
Following code shows how can be formatted a zero (of double type).
[C#]
String.Format("{0:0.0}", 0.0);            // "0.0"
String.Format("{0:0.#}", 0.0);            // "0"
String.Format("{0:#.0}", 0.0);            // ".0"
String.Format("{0:#.#}", 0.0);            // ""

Align numbers with spaces

To align float number to the right use comma „,“ option before the colon. Type comma followed by a number of spaces, e.g. „0,10:0.0“ (this can be used only in String.Format method, not indouble.ToString method). To align numbers to the left use negative number of spaces.
[C#]
String.Format("{0,10:0.0}", 123.4567);    // "     123.5"
String.Format("{0,-10:0.0}", 123.4567);   // "123.5     "
String.Format("{0,10:0.0}", -123.4567);   // "    -123.5"
String.Format("{0,-10:0.0}", -123.4567);  // "-123.5    "

Custom formatting for negative numbers and zero

If you need to use custom format for negative float numbers or zero, use semicolon separator „;“ to split pattern to three sections. The first section formats positive numbers, the second section formats negative numbers and the third section formats zero. If you omit the last section, zero will be formatted using the first section.
[C#]
String.Format("{0:0.00;minus 0.00;zero}", 123.4567);   // "123.46"
String.Format("{0:0.00;minus 0.00;zero}", -123.4567);  // "minus 123.46"
String.Format("{0:0.00;minus 0.00;zero}", 0.0);        // "zero"

Some funny examples

As you could notice in the previous example, you can put any text into formatting pattern, e.g. before an usual pattern „my text 0.0“. You can even put any text between the zeroes, e.g. „0aaa.bbb0“.
[C#]
String.Format("{0:my number is 0.0}", 12.3);   // "my number is 12.3"
String.Format("{0:0aaa.bbb0}", 12.3);          // "12aaa.bbb3"

10 Temmuz 2015 Cuma

The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON Hatası

MS Sql üzerinde kullanıcının şifresini değiştirmeye çalışıyorsunuz. 



ve birde bakıyorsunuz aşağıdaki hatayı alıyorsunuz. 




Msg 15128, Level 16, State 1, Line 1The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON.
çözüm için aslında çokta uğraşmanıza gerek yok. windows Authentication ile oturum açın ve aşağıdaki sorguyu kendinize göre düzeneleyerek çalıştırın ve kullanıcı adınız ve yeni şifreniz ile login olarabilirsiniz..


USE MasterGOALTER LOGIN degisecek_kullanici WITH PASSWORD = ‘YeniSifreGOALTER LOGIN degisecek_kullanici WITH      CHECK_POLICY = OFF,      CHECK_EXPIRATION = OFF;


24 Haziran 2015 Çarşamba

Chrome Silverlight Çalıştırmama Sorunu

Google Chrome 42 güncellenmesiyle Java ve Silverlight gibi uygulamaların çalışmamaya başladı. ” Bu eklenti desteklenmiyor” uyarısı ile karşılaştık.
bu eklenti desteklenmiyo
Applet tarayıcıda yüklenirken bir hata ile karşılaşıyoruz. Chrome://flags bölümüne giriyoruz. Ardından ” NPAPI’yı etkinleştir ” bölümünü bulup  Etkinleştir butonuna basıyoruz ve tarayıcı yeniden başlatıyoruz. Bu yaptığımız işlem Netscape Plugin Application Programming Interface uygulamalarını çalıştırmasını tekrar sağlamak. Java ve Silverlight gibi uygulamalar Netscape Plugin Application Programming Interface dediğimiz yapıdadır.
NPAPI yi etkinleştir
Sorun çözülüyor.
Bu geçici çözüm Eylül 2015 tarihine kadar geçerli Netscape Plugin Application Programming Interface özelliğinde olan uygulamalar bu tarihten sonra çalışmayacak. Artık bu uygulamalara Google Chrome Web Store’den erişeceğiz. Bu ne zaman olur belli değil.

chrome://flags/#enable-npapi uzantısı ile de ulaşabilirsiniz...

27 Nisan 2015 Pazartesi

C# – Çapraz İş Parçacığı İşlemi Geçerli Değil Hatası ve Çözümü

Çapraz iş parçacığı işlemi geçerli değil:  denetimine oluşturulduğu iş parçacığı dışında başka bir iş parçacığından erişildi.

BackgroundWorker ile birden fazla thread çalıştırmak istenildiğinde bu hata alınabiliyor. Çözümü ise çok basit;

Aşağıdaki kod satırı InitializeComponent(); satırının üzerine eklenerek sorun giderilmiş oluyor.



 CheckForIllegalCrossThreadCalls = false;

Seri Porttan Hexadecimal (Hex) Değer Göndermek



using (SerialPort port = new SerialPort("COM1", 9600, Parity.None, 8))
        {
            byte[] bytesToSend = new byte[2] { 0x5A, 0x2B };

            port.Open();
            port.Write(bytesToSend, 0, 2);
        }

27 Mart 2015 Cuma

Select ile Update Yapmak

Başka Tablodan Select ile update yapmak

UPDATE
    Table
SET
    Table.col1 = other_table.col1,
    Table.col2 = other_table.col2
FROM
    Table
INNER JOIN
    other_table
ON
    Table.id = other_table.id

5 Şubat 2015 Perşembe

SQL Server'da Bütün Database'lerin Yedeğini Almak

Sql'de Tum Database'lerin yedeğini almak istiyorsak çözüm basit aşağıdaki kodu çalıştımanız yeterli..


DECLARE @name VARCHAR(50-- database name  DECLARE @path VARCHAR(256-- path for backup files  DECLARE @fileName VARCHAR(256-- filename for backup  DECLARE @fileDate VARCHAR(20-- used for file nameSET @path 'C:\Backup\' SELECT @fileDate CONVERT(VARCHAR(20),GETDATE(),112)DECLARE db_cursor CURSOR FOR
SELECT 
name FROM MASTER.dbo.sysdatabases WHERE name NOT IN ('master','model','msdb','tempdb'OPEN db_cursor   FETCH NEXT FROM db_cursor INTO @name  WHILE @@FETCH_STATUS 0   BEGIN 
       SET 
@fileName @path @name '_' @fileDate '.BAK'
       
BACKUP DATABASE @name TO DISK = @fileName

       
FETCH NEXT FROM db_cursor INTO @name   END 

CLOSE 
db_cursor   DEALLOCATE db_cursor

23 Ocak 2015 Cuma

VMware Workstation “Not enough physical memory is available” Hatası

Diskinizde yer olmasına rağmen yeterli hafiza yok hatası alıyorsanız;

This fix is from VMware communities:

C:\ProgramData\VMware\VMware Workstation.


Dizinine "config.ini" dosyasını oluşturunuz...

config.ini dosyasını Notepad ile açın
ve Şu satırı ekleyin:


vmmon.disableHostParameters = “TRUE”




dosyayı kaydedin ve yeniden başlatın sorun çözülecektir.

VMware Workstation This virtual machine appears to be in use. Hatası ve Çözümü

Vmware çalıştırırken aşağıdaki Hata ile karşılaşıyorsanız. Panik yapmayın çünkü çözümü çok basit;

VMware Workstation 8: This virtual machine appears to be in use. If this virtual machine is already in use, press the “Cancel” button to avoid damaging it. If this virtual machine is not in use, press the “Take Ownership” button to obtain ownership of it. Configuration file: “your location to the VM".vmx”



Cancel dediğinizde bir şey olmayacaktır. “Take Ownership” dediğinizde diğer hata ile karşılaşacaksınız: Veee
Taking ownership of this virtual machine failed. The virtual machine is in use by another application on our host computer. Configuration file: “your location to the VM".vmx”


Veee Çözüm: 
   Vmware'in bulunduğu dizine gidin ve " *.lck "  uzantılı dosyaları bulun ve silin. Tekrar çalıştırın vee mucize :)))



13 Ocak 2015 Salı

Vmware The MSI Failed Hatası – VMware Workstation Uninstall, Repair and Update


Vmware Silerken, Yüklerken veya Tamir ederken Bu hata ile karşılaşıyorsanız çözümü basit 

Aşağıdaki adımlar bana yardım etmedi,

1) Ben yükleme exe dosyası ile ilgili bir sorun olabileceğini düşündüm, bu yüzden indirilen ve tekrar denedi.
2) Windows kontrol panelinden mevcut sürümünü kaldırma, aynı hatayı döndürdü.
3)   kontrol panelinden varolan sürümünü tamir ettim.
4) 10.0.2 yükleme exe dosyasını çalıştırarak varolan sürümünü Rapair ile aynı seçenekleri denedim (Repair, Change ve Uninstall olarak gelir ve hepsi aynı hatayı getirecek))
5) Her Yukarıdaki adımlar arasında birkaç kez denedim ve yeniden başlattım ama sonuç aynı


Çözümü aslında çok basit,


1) Başlat / Çalıştır (Start / Run) 'a % TEMP%  yazın
2) Aşağıdaki Dosyaları silin

 3) Ve... Artık silme işlemini tekrar başlatın sorunsuz silecektir...

6 Ocak 2015 Salı

ASP.Net 3.5 URL Yönlendirme (IIS7)

Yönlendirme Nedir?

Microsoft .NET Framework 3.5 Service Pack 1 ASP.NET çalışma zamanı bir yönlendirme motoru tanıttı.yönlendirme motoru Web uygulamaları için dostu URL'ler oluşturmak için izin, isteğine yanıt fiziksel Web Form gelen bir HTTP isteği URL'yi ayrıştırarak yapabilirsiniz.
Eğer CSharp.aspx adında bir ASP.NET Web Form olduğunu varsayalım, ve bu formu 'Eğitimi' adlı bir klasör içinde olduğunu. Bu Web formu ile bir öğretici görüntüleme klasik yaklaşım yazar görüntülemek için Web Form anlatmak için sorgu dizesi bazı verileri formun fiziksel konumu işaret eden bir URL oluşturursak ve  5 numası yazarların tam bir veritabanı tablosundaki birincil anahtarıdır. değeri örneğin /Tutorial/CSharp.aspx?AuthorID=5: Böyle bir URL sonuna aşağıdaki gibi görünebilir.
/Tutorial/CSharp/5

Yönlendirme için ASP.NET yapılandırma

Yönlendirme için bir ASP.NET Web sitesini veya Web uygulamasını yapılandırmak için, öncelikle System.Web.Routing derlemesine eklemeniz gerekir. .NET Framework 3.5 için SP1 yükleme genel birleştirme önbelleğine bu derleme kuracak, ve  "Add Reference" iletişim kutusunun içinde derleme örneğini bulabilirsiniz.
IIS 7.0 yönlendirme içeren bir Web sitesi çalıştırmak için, web.config iki girişleri gerekir. İlk giriş <modules> bulunan URL yönlendirme modülü yapılandırması, bölümüdür. Ayrıca bir içinde UrlRouting.axd için istekleri işlemek için giriş bölümüne gerekir.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">              
                             
<add name="UrlRoutingModuletype="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

   

</modules>

<handlers>             
<add name="UrlRoutingHandlerpreCondition="integratedModeverb="*"path="UrlRouting.axdtype="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

   


</handlers>
</system.webServer>
Eğer IIS modülü yönlendirme URL'yi yapılandırılmamışsa , PostResolveRequestCache ve PostMapRequestHandler olaylara kendinimiz bağlayacağız.

Rotalar yapılandırma

Şimdi rotayı yapılandırmak için, ilk şey uygulaması başlangıçta rota kayıt etmeli. Uygulama başlangıçta yolları bulması için Global.asax dosyasında aşağıdaki kodu yazmalıyız.
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes();
}
private void RegisterRoutes()
{
RouteTable.Routes.Add("Tutorial",new("Tutorial/{subject}/{AuthorID}"newRouteHandler(string.Format("~/CSharp.aspx"))));
}
İşte {subject}, {AuthorID} ile biz sorgu dizesine ulaşacağız.
Şimdi, biz ihtiyacımız RouteHandler.
public class RouteHandler : IRouteHandler
{
    string _virtualPath;
    public RouteHandler(string virtualPath)
    {
         _virtualPath = virtualPath;
    }
    public IHttpHandler GetHttpHandler(RequestContext requestContext)
    {       
        foreach (var value in requestContext.RouteData.Values)
        {
            requestContext.HttpContext.Items[value.Key] = value.Value;
        }
        return (Page)BuildManager.CreateInstanceFromVirtualPath(_virtualPath,typeof(Page));
    }
}
Şimdi, Yönlendirme sorgu dizesi hakkında yapılandırılmış ama ne olduğunu bilmiyoruz.Sorgu dizelerini almak için biz context.Items ["ID"] yerine Request.QueryString ["ID"] kullanıyoruz.
HttpContext context = HttpContext.Current;
String id = context.Items["AuthorID"].ToString();