8152 - String or binary data would be truncated.

Server: Msg 8152, Level 16, State 14, Line 1
String or binary data would be truncated.
The statement has been terminated.

This error happen when I tried to insert a value too long in a varchar or nvarchar
column:

CREATE TABLE TableName_(id VARCHAR(2))
go

INSERT TableName_ VALUES ('Serkan')

Resolution:
1- Most programmers are lazy they prefer not to change code (and introduce bugs)
INSERT bla VALUES (LEFT('123',2))
2 - Here is one way to do it without changing code but by setting ANSI Warnings to off

SET ANSI_WARNINGS OFF
INSERT TableName_ VALUES ('Serkan')
SET ANSI_WARNINGS ON
--set it back on so code following this won't be messed up

2020 güncel E-Fatura kayıtlı mükellefler Excel listesi

E-fatura'ya kayıtlı mükelleflere aşağıdaki listeden ulaşıp, listeyi excel dosyasına kaydedebilirsiniz. Son güncelleme tarihi 24.02.2020'dir.
Tam ekran için Tıklayınız...

Bilgisayarın çıkış yaptığı internet dış IP'yi bulmak (WhatismyIP.com işlevini görür)

Kullanılan sistemlerde çıkış yaptığınız IP'yi kontrol etmek için aşağıdaki prosedür kullanılabilir. Bu https://www.whatismyip.com/ adresindeki gibi dış IP'yi bulmaya yarar.




 Procedure: 
 private static string GetExternalIp()
        {
            String direction = "";
            WebRequest request = WebRequest.Create("http://checkip.dyndns.org/");
            using (WebResponse response = request.GetResponse())
            using (StreamReader stream = new StreamReader(response.GetResponseStream()))
            {
                direction = stream.ReadToEnd();
            }
            int first = direction.IndexOf("Address: ") + 9;
            int last = direction.LastIndexOf("
");            direction = direction.Substring(first, last - first);
            return direction;
        }


Kullanımı: 
         private void button2_IpGoster(object sender, EventArgs e)
        {
            string externalIP =  GetExternalIp();
        }

Microsoft SQL Server Agent üzerindeki Job çalışmama sorunu (The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. [SQLSTATE 22007] (Error 242))

Microsoft SQL Server üzerinde çalışması gereken job'lardan birisi aşağıdaki hatayı vermeye başladı.

HATA: NT SERVICE\SQLSERVERAGENT. The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. [SQLSTATE 22007] (Error 242)  Cursor is not open. [SQLSTATE 42000] (Error 16917)  Cursor is not open. [SQLSTATE 42000] (Error 16917)  The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. [SQLSTATE 22007] (Error 242).  The step failed.


Job içinde çalışan Script: 

DECLARE @RC int

-- TODO: Set parameter values here.

EXECUTE @RC = [dbo].[SP_PDKSIstanbulGunlukGirisler]
GO

Yukarıdaki Script SQL Management Studio içinde sorunsuz çalışıyor, ancak job içinde çalışmıyordu. Bunun nedeni job'u çalıştıran user'ın "NT SERVICE\SQLSERVERAGENT özelliklerinden default language özelliğini "Turkish" olarak değiştirdikten sonra Job sorunsuz çalıştı. (job içindeki SP'nin 'SP_PDKSIstanbulGunlukGirisler' içinde tarih hesaplamaları TR ayarları olduğu için Türkçe, sizin örneğinizde tersi olabilir)




BlackListIP control on Serenity platform (.NET Core)

 In the Serenity platform, if you want to block IPs that belong to people you do not want to come from outside in the .net core web project,...