c#-2.0

“There is insufficient memory. Save the document now.” error while opening word 2003 document

ⅰ亾dé卋堺 提交于 2020-01-05 10:34:29
问题 I have developed one windows service through which I am trying to open an word document. But when service tries to open document, it logs following error "There is insufficient memory. Save the document now." If I run the same program as normal windows application, it works fine but problem comes only when I try to run the program as windows service. I tried to google this problem, but there arent many answers about this problem. Is there any way to increase the memory limit for windows

Difference between idleTimeout and ShutdownTimeout

て烟熏妆下的殇ゞ 提交于 2020-01-04 14:21:43
问题 I am trying to relax my website's session expiration policy so that the users may specify the session timeout interval. I need to figure out what website related settings should I specify in order not to limit the users too much. For example, one might want a 1 day interval. I will be using tickets to accomplish that. Now, I know I can specify the idleTimeout and shutdownTimeout in my website's web.config file (I prefer this method as it's damn easy to adjust it without the whole deployment

How do I set the UI language for a multi-threaded .NET process, independent of the OS language?

守給你的承諾、 提交于 2020-01-04 04:57:06
问题 Problem: I have a C# .NET 2.0 application developed on Windows 7 that has translated resources for multiple languages (ex. zh-CHS for Chinese, es for Spanish, etc.). I have a customer who wants to run their Windows 7 OS in English, but run my .NET application in Spanish ( es ). My application is multi-threaded, so just changing the culture of the main GUI thread is not sufficient for my needs (trust me, I tried). This is because other strings displayed to the user through the GUI are

System.StackOverflowException

我的梦境 提交于 2020-01-04 04:13:07
问题 please help me regarding System.StackOverflowException i m desing a .aspx to write records into the database i used 4-tier archietecture to implement this everything are working but when im compiling the page then its displyae the fields to insert the data ,when i insert the data to those field and clik the submitt button then its showes System.StackOverflowException occured public class Customers { public Customers() { int CustomerID = 0; string Fname = string.Empty; string Lname = string

.Net dll reference - deployment onto PCs with different versions of 3rd party dll

萝らか妹 提交于 2020-01-03 00:39:11
问题 Could you tell me the best approach for this scenario. I have inherited a new project and have not come across this scenario before. We have a reference in our C# Windows Forms application to a 3rd party tool for producing documents. There are two different versions of the 3rd party tool in the deployment environment installed on people's PCs - v1.0 and v2.0. I can only build our Windows Forms application to work with either v1.0 or v2.0 of the 3rd party tool. To do so I have to install

Using base class as generic for IEnumerable<T>

☆樱花仙子☆ 提交于 2020-01-02 05:34:09
问题 I have a good understanding of OOP in general, inheritance and polymorphism, interfaces, etc. I encountered a strange situation and I don't understand why it does not work at all... EDIT : Ok, I found out that covariance (or contravariance?) may solve this problem, but crucially we're still using .NET 2.0 How can I solve this without moving to C# 4.0 ? Here is the situation. Given these two classes : public class CustomCollectionType<T> : IEnumerable<T> { /* Implementation here, not really

Unable to call Dispose?

放肆的年华 提交于 2020-01-02 01:11:49
问题 This one has confused me a little... Attempting to dispose of an XmlReader XmlReader reader = XmlReader.Create(filePath); reader.Dispose(); Provides the following error: 'System.Xml.XmlReader.Dispose(bool)' is inaccessible due to its protection level however the following is fine: using(XmlReader reader = XmlReader.Create(filePath)) { } When I look at the definition in Reflector I can't understand why I can't call Dispose Implementation of Dispose: Can anyone point out what I'm missing? 回答1:

How to get the accurate total visitors count in ASP.NET

梦想与她 提交于 2020-01-01 03:44:11
问题 I want to know the number of visitors online on my site. I did my research and found two solutions. Source: Code Project Online active users counter in ASP.NET It is easy to setup and easy to use but it increases the user count for every Ajax request/response too. My home page alone has 12 Ajax requests(8 requests to one page and 4 requests to another page). This dramatically increases the user count. Source: Stack Overflow Q/A Count the no of Visitors This one works exactly the same as the

Using an 'IN' operator with a SQL Command Object and C# 2.0

若如初见. 提交于 2019-12-31 01:47:49
问题 I would like to call a sql statement such as: Select * From Table Where Column in ('value1', 'value2', 'value3') Is it as simple as setting a command parameter's value equal to " ('value1', 'value2', 'value3') "? 回答1: @Charles: You're going into the right direction, but we're using parametrized queries to mainly prevent SQL injections. Putting 'external' values ( params string[] args ) hardcoded in queries is asking for trouble. You can iterate the arguments, but you still have to use

How to make a textbox accept only digits and formats numbers with commas?

帅比萌擦擦* 提交于 2019-12-29 07:02:50
问题 I need a text box that: (1) only accepts digits as characters. (2) automatically continues to format numeric values with commas as the user types into it. For example, 1 becomes 1.00 10 becomes 10.00 100 becomes 100.00 1000 becomes 1,000.00 10000 becomes 10,000.00 100000 becomes 1,00,000.00 How to achieve that? 回答1: Formatting a number while the user is typing in general works very poorly. You should use a MaskedTextBox for that. Plenty of code about on the Internet that shows how to filter