Kayıtlar

Kasım 10, 2010 tarihine ait yayınlar gösteriliyor

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 sproc you don’t have the necessary rights to