.net

Why does scrolling position change after refocusing the Form?

Why does scrolling position change after refocusing the Form? Situation: Design mode and application just started Remark the scroll panel position. Scrolling manually the panel to left with mouse Changing the focus to other application and refocusing back our application(click/click) You can see that when the application loses...

Is it possible to change the pluralized name of a LINQ table?

For example, my table name is "Diagnosis". When I bring it into my LINQ to SQL model, it tries to figure out how to pluralize it, and it mistakenly assumes the entity name should be "Diagnosi" and the set name should be "Diagnosis", which could be confusing. When I change the entity name to "Diagnosis" in the properties, it doesn't chan...

Compiling nested mutually recursive function

I'm creating a toy dynamic language (aching towards javascript) and while my implementation is on top of the DLR, I figured the solution to this problem would be pretty language/platform agnostic. I have no problem with compiling recursive functions, or mutually recursive functions that exist next to each other. But compiling nested mut...

One of my projects does not compile unless I am using Debug mode

Hi, I am having difficulties compiling the test project in my .NET solution solution when using any configuration other than "Debug". I am using a third party assembly (Ninject), the assembly is referenced as usual in my project settings. It works fine in Debug mode, but when switching to relase I get this error: Error 13 The type ...

Unable to find Assembly error when using <codeSubDirectories> in web.config

I have a web site that uses the both c# and vb.net in the app_code section. The different languages are separated into their own folder and correctly configured in the web.config. <codeSubDirectories> <add directoryName="BasicCode"/> <add directoryName="CSharpCode"/> </codeSubDirectories> This works fine 95% of the time. In ...

c# Writing to a file without using using{}

Hi peeps I'm writing a little application whereby I want to write the results of the operations to a file. Basically what I want to do is open a stream to a file (I'm thinking FileStream, but am open to suggestions), write data to the file, then close it at a later date. So I've got a class called ReportFile, with methods: .Create( s...

How to get the DateTime when the current process started?

................. ...

How can I update a setting based on the build?

I have developed a HTTP resource, that uses the Last-Modified header, and it should reflect any modifications made to the application. I would like to update this field to tell the build date, or the last application update date. Here is some solutions I have thought of: Use a build script to change a DateTime setting whenever the app...

Who should own the private key used to sign a .NET assembly when its project is open-source?

More specifically, a class library assembly. My initial thoughts: Have some designated administrators do all the assembly signing. But then when bug fixes and new versions are written, the binaries would ultimately depend on them being around (even if its just a small change for private reasons). The key could be publicly available. Bu...

DataGridView.Column(ColumnName as String) gives error "Object reference not set to an instance of an object"

This is something that has been bugging me for a while as it is easily fixed but not desirable. I have a DataGridView that has 5 columns. The first is called ID. In vb.net the following line gives an error "Object reference not set to an instance of an object": dgvJobs.Columns("ID").Visible = False ' ERROR dgvJobs.Columns(0).Visible ...

.Net Reorder DataGridView Columns at runtime

Hi, Is there a simple way to re-ordering the columns of a DataGridView that are bound to a DataSet at runtime? I can do it simply via the DataGridView "Edit Columns" dialog at design time but have to remember to do this every time make changes to the form (remove or add the DataGridView to the form). Thanks ...

.net Interface explanation

I understand that an interface in .Net defines a contract between the interface and a class that inherits it. Having just gotten done working on a project that made heavy use of an interface for the Data Access Layer, it got me thinking . . . whats the big deal? When I had to add a new method to the DAL, I had to create the method sign...

Read embedded file from assembly

Hi I have to pass the path of a config file to a framework method (Gurok SmartInspect). The config file is an embedded resource of the assembly. Currently I read the file from the assembly and store it outside and then pass the pathName. Is there a better / less complicated way to achieve this goal, without copying the file? private...

LINQ method with varying parameters

I have a LINQ method for the Search page of an in house app. The method looks as below public static DataTable SearchForPerson(String FirstName, String MiddleName, String LastName, String SSN, DateTime? BirthDate) { var persons = (from person in context.tblPersons where person.LastName == LastNam...

Why is Regex VB.Net Dropping "-" When Getting Matches?

Trying to parse this and return the following 3 items: -30.25 31.46 -27.46 31.74 -24.57 32.03 -16.86 32.88 -13.82 33.19 -9.69 33.62 Using this regex expression below I get the matches, but drop the leading "-" at the front of each grouping. I get the "-" in the middle of the group though. Here is the expression I currently use. Di...

Problem with event "chaining"

Note: I edited this question to make it easier for other people with the same problem to get help here. To see the original question that fits better with some of the answers, check the edit history. In a project I have a ExecutionManager class that can contain multiple ExecutionSlot's instances. The ExecutionSlot class have several pub...

Quartz.Net Thread Pools

I have quartz.net set up to run several scheduled jobs and several polling jobs. The polling jobs can consist of running code that can take 10 minutes. These jobs are queued from user actions (and so there could be a queue of x user actions). I have scheuled jobs that HAVE to run at that time. However, the threads could all be used up by...

Implementing Centralized Hotkey Handling/Processing

I'm working on a project where I need to implement customizable hotkeys across the application. There are a number of different forms and user controls that need to implement different subsets of hotkeys. I would like to implement all of the handling and processing in a central MessageFilter class. I want to have a base class that h...

HttpWebRequest.AllowAutoRedirect=false can cause timeout?

I need to test around 300 URLs to verify if they lead to actual pages or redirect to some other page. I wrote a simple application in .NET 2.0 to check it, using HttpWebRequest. Here's the code snippet: System.Net.HttpWebRequest wr = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create( url ); System.Net.HttpWebResponse resp = (S...

Why do I need "field:" in my attribute declaration "[field:NonSerialized]"?

I can't find "field" listed as a C# keyword anywhere. Does anyone know the background on this? ...