.net

Is there any good reason to convert an app written in python to c#?

I have written several Python tools for my company. Is there any good reason to convert them from Python to C# now that their usefulness has been proven? Would I be better off just leaving them in Python? ...

Where should I generate temporary files for my application?

I've been warned by several people not to store temporary files in the Temporary Internet Files directory. Where would be the best place to store any temporary or log files that my application generates? ...

Sharing code between compact and full .NET Framework

I have a whole bunch of projects which I want to reuse between the .net compact framework and the full framework. I have read Daniel Moth's incredibly informative article about this subject (http://msdn.microsoft.com/en-us/magazine/cc163387.aspx) So the two main methods are: 1) Target the compact framework (ie. go for the lowest common...

ASP .NET - Setting the value of a DetailsView TextBox

I am attempting to use the code-behind (Page_Load or PreRender) to set a date-time textbox in a DetailsView so that it defaults to a current date-time. What I have attempted is (one of many variations): protected void DetailsView2_PreRender(object sender, EventArgs e) { ((TextBox)DetailsView2.FindControl("date_time")).Text = ...

Getting the item under mouse cursor in a listview control?

Basically I am trying to implement a feature where if the user presses a key, I want to find out the item under the mouse cursor. So I don't use Mouse events but Keyboard events which doesn't give me a ListViewItem of course. I just don't know in what space I need to get the mouse position and convert it into the control's space. Any ...

How to configure .NET's WebBrowser to obey the current language settings

I am using the System.Windows.Forms.WebBrowser object for displaying and printing a report. Unfortunately the Page Setup dialog is not obeying the language settings on the user's computer and all of the text is coming up in English. The .NET dialogs for opening and saving a file are coming up in the correct language but not the Printing/...

How to locate DLLs for inter-component referencing

My SAAS company has two C#.NET products, call them Application Alpha and Application Beta. Both of them reference some libraries that we can call Core. At the moment, the codebase is monolithic, stored in a single SVN repository with a single .NET solution, and we're trying to make it more modular/componentized. We've split off into s...

Control Hardware (TFT Display, Monitor) with .NET / C#

Hi, I know, I am propably way out of line here :-) I want to control my Display from within a .NET application. Background is simple: There is a really nice Tablet which should become my little helper. For this reason, it will be always on. But the display can be switched off if not needed, and switched on when something interesting ha...

How can I improve WMI performance in .NET?

I've inherited code that makes numerous remote WMI calls. When I repeatedly pause execution and look at the call-stack it's almost always in a ManagementScope.Connect() call. A new connection seems to be made with each WQL query. Despite limited trial and error, I haven't found any big wins yet in improving the performance of the WMI ...

Entity Model and binding Label to an unrelated table

I am trying to figure out the best way to bind to an unrelated table in .Net. I have an ADO .Net Entity data model which contains several related tables and a few unrelated tables. For example, I have the following tables: KEY_VALUE_LKP with columns LKP_TEXT, LKP_VALUE and LKP_TYPE REQUEST_DET with columns REQUESTNO, USERID, and REQ_S...

Persisting string value in .net Windows Form

Hi Everyone, I'm wondering what is the easiest way to persist a string value, once the form and program are shutdown that I want to use again later when they open the program and form later. In my case I'm using a FolderBrowserDialog and saving the directory the user picks. I know I can use File.IO and such, but just wondering what ev...

How to push SQLCLR updates to your (CI) server

I'm re-using some .NET code between SQL 2005 server and WinForm clients using SQLCLR. This code has dependencies beyond .NET 2.0 which means I have to add these assemblies on the server machine (e.g. CREATE ASSEMBLY). I'm trying to do this as part of a CI build and am wondering what methods have worked best. ...

Event Signature in .NET -- Using a Strong Typed 'Sender'?

I fully realize that what I am proposing does not follow the .NET guidelines, and, therefore, is probably a poor idea for this reason alone. However, I would like to consider this from two possible perspectives: (1) Should I consider using this for my own development work, which is 100% for internal purposes. (2) Is this a concept that...

Having Multiple Outputs for a single action

Hi guys, just a question that needs a quick answer, I have a Action, lets say, BlogPostController.List(); Which lists all the Posts in a hypothetical blog engine. I want both a HTML output of this data and an XML output of this data. Preferably I'd like to be able to address these purely by URL, for example: http://MyHypotheticalB...

What's the difference between an SQL transaction at the stored procedure level and one at the SqlConnection level?

Say a stored procedure on MSSQL Server uses an SQL transaction using BEGIN TRANSACTION/COMMIT TRANSACTION, how does that differ from beginning and commiting one using ADO.NET via SqlConnection.BeginTransaction()? ...

.NET equivalent of MFC function SetModifiedFlag

I am porting a C++ COleControl that frequently makes calls to SetModifiedFlag(bool). What is the equivalent call in .NET? The MFC documentation implies that this is only necessary when persistent state has changed, and I am unsure what would be considered persistent state in .NET controls. SetModifiedFlag(); ...

Converting GUID to String

why doesn't this work? MsgBox("F6D8C47B-46E6-4E93-A393-00085ACA2242").ToString.Replace("-", "") ...

Constructor injection working... Property injection not so much

I am using Composite Application Block. I have a class that uses constructor injection (using the [ServiceDependency] attribute on the constructor parameter) and it's working. But when I try to switch to using property injection (with the [ServiceDependency] attribute on the property), the injection is not happening (the property stays...

Validate a Word 2007 Template file

I'm developing a solution that allows people to upload a DOCX file as a template. This template is used for generating Word documents with database info. What I would like to do is once a template gets uploaded, to check it for errors. (I don't want my parser crashing when a template is used.) I've seen the question about checking a ...

Time only pickers for .NET WinForms?

There are tons of good date pickers out there for Windows forms, but I have yet to find any good time only pickers. Any suggestions? EDIT I guess I should be more clear. I am talking about a nicer looking time picker. We use a commercial control suite, and the default time picker looks out of place because it is so plain. ...