.net-3.5

Listview ItemSelectionChanged fires twice?

一曲冷凌霜 提交于 2020-01-28 05:47:24
问题 I have a Winforms App in C# with a ListView control. This ListView shows a list of TO-DO items and I am using the 'ItemSelectionChanged' event to handle updates. The problem is that the 'ItemSelectionChanged' event fires twice each time I try to make an update. The ItemSelectionChanged event refreshs the form to represent the updates (ie remove item from list). Is there a way to disable the event from firing after the refresh? UPDATE1: private void listView1_ItemSelectionChanged(object sender

WPF Textblock text does not change dynamically on combobox selected item

自古美人都是妖i 提交于 2020-01-25 10:40:24
问题 I have a MVVM app. In main WPF window I have a combox and a textblock among other controls. When I select a value from the combobox, the textblock text should change its text value dynamically according to the item selected in the combobox (depending on the id of the selected item in combobox). My problem is that when I select a item in the combobox, textblock text does not change, it always have the default value. Any ideas how to solve this? I want to do this using xaml only. Model : public

Why Does My ASP.NET Cache Keep Clearing Itself?

耗尽温柔 提交于 2020-01-25 00:32:07
问题 I have a .Net 3.5 application installed on a server running Windows Server 2003 SP2, IIS 6. Every few minutes the cache it clearing itself. This doesn't happen when the traffic is low. This is the performance graph taken with Process Explorer, every drop in the graph is when the cache is cleared. The system has 8GB of RAM. In the same app pool there are several applications but the cache is not being reset at the same time. The app pool doesn't have Memory Recycling turned on. What should I

How do I get DebuggerBrowsable RootHidden to work?

偶尔善良 提交于 2020-01-24 01:00:08
问题 I read about the DebuggerBrowsable attribute yesterday, and it sounded great, however when I tried to get it to work in a test, It doesn't seem to make any difference. I am using VS 2008 version 9.0.30729 1 SP, .Net 3.5 SP1, MSTest framework [TestClass] public class TestingDebuggerBrowsable { [TestMethod] public void JustToDemonstrateDebugging() { var foo = new MyExposedClass(); foo.ToString(); // I put a breakpoint here, and debugged the test } } public class MyExposedClass { public

Extend base type and automatically update audit information on Entity

跟風遠走 提交于 2020-01-23 13:59:27
问题 I have an entity model that has audit information on every table (50+ tables) CreateDate CreateUser UpdateDate UpdateUser Currently we are programatically updating audit information. Ex: if(changed){ entity.UpdatedOn = DateTime.Now; entity.UpdatedBy = Environment.UserName; context.SaveChanges(); } But I am looking for a more automated solution. During save changes, if an entity is created/updated I would like to automatically update these fields before sending them to the database for storage

Extend base type and automatically update audit information on Entity

帅比萌擦擦* 提交于 2020-01-23 13:58:54
问题 I have an entity model that has audit information on every table (50+ tables) CreateDate CreateUser UpdateDate UpdateUser Currently we are programatically updating audit information. Ex: if(changed){ entity.UpdatedOn = DateTime.Now; entity.UpdatedBy = Environment.UserName; context.SaveChanges(); } But I am looking for a more automated solution. During save changes, if an entity is created/updated I would like to automatically update these fields before sending them to the database for storage

TransactionScope and Connection Pooling

折月煮酒 提交于 2020-01-22 18:40:51
问题 I'm trying to get a handle on whether we have a problem in our application with database connections using incorrect IsolationLevels. Our application is a .Net 3.5 database app using SQL Server 2005. I've discovered that the IsolationLevel of connections are not reset when they are returned to the connection pool (see here) and was also really surprised to read in this blog post that each new TransactionScope created gets its own connection pool assigned to it. Our database updates (via our

TransactionScope and Connection Pooling

僤鯓⒐⒋嵵緔 提交于 2020-01-22 18:40:46
问题 I'm trying to get a handle on whether we have a problem in our application with database connections using incorrect IsolationLevels. Our application is a .Net 3.5 database app using SQL Server 2005. I've discovered that the IsolationLevel of connections are not reset when they are returned to the connection pool (see here) and was also really surprised to read in this blog post that each new TransactionScope created gets its own connection pool assigned to it. Our database updates (via our

Cannot find System.Web.Script.Service namespace error after upgrading to Visual studio 2010

戏子无情 提交于 2020-01-22 12:33:07
问题 I've just upgraded a VS 2008 project to VS 2010, converting the project but keeping the target as .NET 3.5 (SP1 is installed). My project worked without issue under VS 2008 on another machine. I've added references to System.Web.Extensions.dll but I'm still getting the following errors from code in the App_Code folder: 1) Cannot find System.Web.Script.Service namespace. 2) Type 'System.Web.Script.Services.ScriptService' is not defined. 3) Type 'System.Runtime.Serialization.Json

How do I make a marquee progress bar in WPF?

有些话、适合烂在心里 提交于 2020-01-20 18:18:25
问题 In Winforms I could set the ProgressBarStyle of a progress bar to Marqee, and that would have the progress bar incriment on its own without having to be set, for processes where I don't know how long its going to take, and no good way to report back to the UI. I would like to do the same in WPF, but I can't find a way to pull it off short of hosting a winform progress bar, which seems counter productive. How can I pull this off in WPF? Do I have to host a winform progress bar? 回答1: I think