Kayıtlar

List Box Item içindeki elemanları aşağı veya yukarı taşımak

Bu fonksiyonu kullanabilirsiniz. Aşağı ve yukarı butonları şekildeki gibi çağırabilirsiniz. Buttondown ilgili ögeyi aşağıya indirecektir. ButtonUp ilgili ögeyi yukarı taşıyacaktır. protected void ButtonDown_Click(object sender, EventArgs e) { MoveListboxItem(1, ListBox2); } protected void ButtonUp_Click(object sender, EventArgs e) { MoveListboxItem(-1, ListBox2); } private void MoveListboxItem(int index, ListBox listBox) { if (listBox.SelectedIndex != -1) //is there an item selected? { //if it's moving up, the loop moves from first to last, otherwise, it moves from last to first for (int i = (index < 0 ? 0 : listBox.Items.Count - 1); index < 0 ? i < listBox.Items.Count : i > -1; i -= index) { if (listBox.Items[i].Selected) { //if it's moving up, it should not be the first item, or, if it's moving down, it should no...

Table Variables

Sql'de saklı yordamlar ile çalışırken saklı yordam içinde dinamik t-sql bir değer döndürüyorsanız ve bu sp'yi entity framework 4.0 ile kullanıyorsanız "The selected stored procedure returns no columns" hatası alabilirsiniz. Bunu çözmek için Table variables kullanabilirsiniz. Örnek -- tablevariable declare edilir ve içinde dönecek kolonlar tipleri ile belirtilir. Declare @MyTableVar table (Hab int, Ord int, TiBas nvarchar(max) ) -- table variable ilgili sp sonucu atanır Insert @MyTableVar Exec Cms_Anasayfa_SelectedNews_Select -- atanan değer çağırılır. Select * from @MyTableVar Amplify’d from searchsqlserver.techtarget.com Table variables Table Variables objects objects Table variables are objects similar to temporary tables and were introduced in SQL Server 2000. A table variable is declared using the table data type. A statement declaring a table variable initializes the variable as an empty table with a specified structure. As a table defini...

Entity Framework 4 ile çalışırken karşılaştığım hata "The selected stored procedure returns no columns"

"The selected stored procedure returns no columns" bu hatayı çözmek için aşağıdaki sayfada birden fazla çözüm yeralmakta ben sorunu sp'nin değerlerini table variable döndürerek hallettim. Amplify’d from mysoftwarenotes.wordpress.com Entity Framework 4 – The selected stored procedure returns no columns You create a stored procedure, you bring it into your entity model, you start to create a function import, you click the “Get Column Information” button and you get “The selected stored procedure returns no columns.” The reasons I’ve seen for this are: The solutions I’ve found are: For #1 You are returning your result set using dynamic sql, so EF can’t figure out at design time what the shape of the results will be. You are selecting from a temp table and EF can’t figure out the shape of the results at design time. Your stored procedure crosses databases and although you have all the rights you need in the database containing...

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Amplify’d from www.hayrullahguven.com The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. Bu hatanın çözümü tarih formatından kaynaklanıyor. MsSqlServer de standart olarak ingilizde dil ayaarı olarak gelir ve o dilin kültürü kullanılır. Tarih formatıda dolayısıyla ay.gün.yıl olarak çalışır. Buna karşın biz ise gün.ay.yıl formatını kullanırız işte. Çözüm ise gayet basittir. Convert. :) Bir insert cümlesi için örnek verecek olursak Insert Into tablo_adı ( tarih_alanı ) Values ( Convert(DateTime, '25.12.2009', 104)) gibi bir örnek olur. Aynı convert metodunu select update sqlleri içinde kullanabilirisniz. Read more at www.hayrullahguven.com   See this Amp at http://amplify.com/u/djmt

IIS 7.0 üzerinden dosya yüklemek 30 mb ile sınırlıdır

30 mb üzerindeki dosyaları IIS 7.0 üzerinde yüklemek isterseniz şekildeki gibi bir hata mesajı döner. “ You are probably hitting the file upload limit of IIS7.By default in IIS 7 requestFiltering  has the MaxAllowedContentLength property enabled.It specifies, in bytes, the maximum length of the content in a request. The default is 30MB. To change this value you must edit %windir%\System32\inetsrv\config\applicationHost.config file.” İster applicationHost.config dosyasından isterseniz web.config dosyasına <system.webServer> düğümü içerisine aşağıdaki kodu yazmanız daha büyük dosyaları yazmanız için yeterli olacaktır. <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="1000000000"/> </requestFiltering> </security> </system.webServer>

Sql'de belirli bir alan içindeki değerleri güncellemek istersek

UPDATE [TabloAdı] SET     [Alan] = replace ( [Alan] , 'eskideger' , 'yenideger' ) WHERE   [Alan] LIKE '%eskideger%' ;  

HTTP Error 500.22 - Internal Server Error

Resim
2008 Server'de IIS'te kurduğunuz yeni sitede aşağıdaki gibi bir hata alıyorsanız "An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode." Yapacağınız İşlem Web.config dosyasında System.Webserver namespace altına <validation validateintegratedmodeconfiguration="false"> komut satırını eklemektir. Böylece siteniz düzgün çalışacaktır. Amplify’d from blog.benhall.me.uk "An ASP.NET setting has been detected that does not apply in the Integrated managed pipeline mode" Read more at blog.benhall.me.uk See this Amp at http://amplify.com/u/cmqs