.net

DatagridViewCheckBoxColumn positioning the checkbox to the left with text following it

i had created a custom checkbox cell and column just to display a text along with the checkbox. the custom paint gets the bounds and paints the string. the issue i have is, the checkbox is always @ center. and the text follows it. On the other hand, i want the checkbox to appear to the left corner and the text to follow it from there. ...

Master page property access from Content page.

FROM BOOK: To reference public properties in a master page, we add the @MasterType declaration to the content page and reference the property using Master.<PropertyName>. QUESTION: But what happens internally? Does all of the master's and content page's properties, function gets complied into one class? Or something else? ...

SQL Server connection pool doesn't detect closed connections?

For years, I've experienced very weird problems on all my web applications that connect to a SQL server. The problem is that if something happens to the database server (server restart or other problem), de web app stops working from that point on, even if the database server is alive and well afterwards. What happens is that every ADO...

Passing constructor parameters when resolving types in Unity: Best practice

It's sometimes necessary when using dependency injection to provide the parameters to use in the constructor. This is something that's supported in Unity (and other dependency injection containers), so that when it tries to create an instance of the type, it can provide your arguments as parameters in the constructor. My question is: is...

DataGridView - how to set column width?

Hello fellows, I have a WinForms application with DataGridView control. My control has five columns (say "Name", "Address", "Phone" etc) I am not happy with default column width. I want to have more control over column appearance. What I want is to be able to do one of the following: Set width of each column in percent Set width of e...

WinForms: Autocomplete in multiline textbox

Does anybody know of any solution how to provide autocompletion suggestions (say to help input keywords from a list) for a multiline WinForms TextBox/RichTextBox? For a single line textbox, this is very easy. Multiline is obviously not implemented directly by Winforms. ...

Code Contracts: How do I state in a post-condition that a field/property's value has not changed?

I'll best just show with a code example what I would like to accomplish? class SomeClass { public int SomeProperty; public void SomeOperation() { Contract.Ensures( "SomeProperty's value has not changed." ); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // How can I write t...

Confused on CTS in .net

CTS does all the required conversion of datatypes so as to enable the execution of code by .net. Then how come when we try to implement pointers it is not mapped by it rather we have to explicitly convert the code ? ...

FilgraphManagerClass taking up lots of memory resource

I'm using FilgraphManagerClass, which is contained in this dll : QuartzTypeLib.dll. it's using up a lot of memory resource and CPU. How do I clean it up and make it eat up less resources ? or how do I dispose of it after using it ? ...

How to increment automatically the version of an assembly if there are changes on the code?

Hello, there is a way of incrementing the version number of an assembly automatically if the assembly has changed after doing a build of the solution? I've tried with post-build events but then you increment the version on each build, not only if the build process has compiled anything due to changes. Thanks in advance. EDIT: What I ...

C# ColumnHeader's free space background color.

Hey, I'm trying to draw custom ColumnHeaders in a FastObjectListView control. So far the code works, but the ColumnHeaders free space ( so the part that does not contain any column headers atm ) still draws as default. private void olvMain_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e) { e.Graphics...

.NET OpenXML SDK 2 RunProperties are Null

Hello, I'm trying to read Word 2007 docx document. The document looks fine inside Word, but when i try to read id using my code, all Run objects have RunProperites set null. The property that I'm most interested in is RunProperies.FontSize, but unfortunately it is null as well, the only property I can access is InnerText. My Code l...

Problem with System.Diagnosis.TextWriterTraceListener not writing any log to the filesystem

Hi, To solve an issue with sending e-mail through a smtp-server where e-mails are not getting sent, I was adviced to enable logging using System.Diagnosis.TextWriterTraceListener to trace the communication with the smtp-server to track any errors. I added the following to my web.config under the node: <system.diagnostics> <trace...

Is there a naming convention for the output of merged assemblies

We're using ILMerge to combine a (sub...i.e. not the startup project)project assembly and it's dependent assemblies into one assembly. The sub project is named like so...MainProjectNameSubProjectName so that when it compiles it creates an assembly named MainProjectNameSubProjectName.dll. Now we run ILMerge to combine all the assemblies...

Getting a javascript error in a c# .net WebBrowser component

Hello, I'm having a problem with some of our users getting a javascript error popup when accessing our online store via our software. The software uses a standard WebBrowser control and the users getting the error include those with IE versions 6,7 and 8 and .net 2 and 3.5. The error does not appear when they access the store directly t...

Are there any free code editor WinForms controls?

I'm searching for a free text/code editor WinForms control just like ScintillaNET. I cannot use ScintillaNET, because it doesn't support Mono. Ideally it should be a pure managed control. ...

How to store fungible data?

I am writing a .net application that is taking form information to do some car loan prequalification calculations and will store this in a database. The trouble is every field should allow the user to type any kind of string data into it and preserve it into the database. Most of the fields need to be converted to decimal or integer v...

how to call php functions from .NET WPF application?

So I'm going to bild a simple PHP CMS. I need to know how should I bild it to be able to call its functions from .NET WPF application. And how to call PHP functions and send forms from WPF .NET application... BTW: I'm going to have users with passwords that would need some form of autentication. after which they'll need to call that fu...

Strange .Net datetime issue

Setting with a ternary DateTime filterDate = endDate.HasValue ? endDate.Value : DateTime.Now.AddDays(7); Non ternary DateTime filterDate; if (endDate.HasValue) filterDate = endDate.Value; else filterDate = DateTime.Now.AddDays(7); If you debug these two statements the value of filterDate will not be the same. Why is this? ...

Session_End event behind load balancer

I'm creating web application behind load balancer. To this moment I configured it to store session in database but I'm not sure how should I handle session expiration. The problem is not sessions are not removed from database but Session_End event because I have to call some web service method in it. Assuming Session_End is called when ...