.net

Finally: is it guaranteed to be invoked in any case

Is there any even small possibility that finally will not be invoked but application still be running? I'm releasing semaphore there finally { _semParallelUpdates.Release(); } and afraid of lost of some of them. ...

Ms Word plug-in with Java

Hi, I'm developing an advanced spellchecker for some language. MS Word's default spellchecker for that language is not satisfactory. So I decided to integrate my spellchecker with MS Word. Unfortunately I'm working on Java and as far as I see this is possible with Ms.Net. Is it possible to do same thing with Java or can use a my Java sp...

Regular Expression Question

I have tried many things but I can not figure out how go get a match on the following string Here is my example. Btw using 2.0 compact framework if it matters. string received = "AT+CMEE=1\r\r\nOK\r\n"; Regex regex = new Regex(received , RegexOptions.Multiline); // I have tried many things Match match1 = regex.Match(".*AT\+CMEE=1\r\...

Detect if the computer is using a mobile connection (3G/EDGE/GPRS) on Windows

I need to determine if the computer is connected to the Internet using a mobile connection (e.g. 3G, EDGE, GPRS). I found this identical question, but the accepted answer isn't very helpful to me... The System.Net.NetworkInformation.NetworkInterface class exposes a few properties, but nothing that can help me determine if it is a mobile ...

reflection retrieve private methods of a class

I want to retrieve private (implementation and other) methods of a class which implements an interface and also is derived from (inherits) a base class. How can I achieve this using reflection? Is there anyother way to achieve this? This is wat m tryin to do. I need to view these private methods and their contents, I don't want to in...

How to properly escape SQL when using BindingSource's Filter property

I've inherited a C# application that lists data from a database table via a DataGridView. There are also a few text fields used to filter that data. This is done like so: String listFilter = string.Format("City = '{0}'", this.toolStripSearch.Text); this.customersBindingSource.Filter = listFilter; toolStripSearch is a text field for se...

"Register for COM Interop" vs "Make assembly COM visible"

What is the real difference between these two options? What I know is: Register for COM Interop This options executes regasm on the assembly and registers the assembly as an COM component(or maybe not) in the registry with all COM like registry entries. Does this step generates a TLB file? What else is done? Sometimes I see a tlb is ge...

New feature MEF in .net 4.0

Managed Extensibility Framework is the new feature of .net 4.0. What is it ? and How to use it in our existing application ? ...

How FirstOrDefault extension method works?

I was wondering on how FirstOrDefault extension method works? Which one of the following algorithms does it follows? Use: var arr = new[] {1, 2, 3, 4, 5, 6, 7}; return arr.FirstOrDefault(x => x%2 == 0); Algorithm 1: for(int i = 0; i < arr.Length; i++) { if(arr[i] % 2 == 0) return arr[i]; } return 0; Algorithm 2: var list ...

Without using database how Can I Search for a word and display it's related content in another field

So the question can be reformatted as "What can replace a database in an offline version?" The initial idea is inspired from wordweb where you just type the word and then you get the meaning of it displayed in a fraction. Of-course they are not saving all the words and there meanings in a database. What are they using? Are they storing...

sql connection string problem

I have Database (compact sql server) in a *.sdf file. I converted a compact framework project to a regular pc project and for some reason, with the same code, and the same *.sdf file the following exception was thrown: "the file name is not valid. check the file name for the database" the weird thing is that on my Pc - the substring "fi...

Writing apps in JScript 5.5 instead of JScript.NET

As some of you may know JScript.NET adds quite a few features to the common JavaScript language... it adds some class syntax, some type identifier etc etc.. The main reason I use JavaScript is because I love how dynamic it is, nested function calls, variables scope etc etc... All these features seem to work fine in the .NET version, how...

Binding to a textbox

Hi all, I'm using a DetailsView Control to perform an insert into my database. I've no problems doing this when I set the fields for the DetailsView control on the aspx page.... <asp:TextBox ID="InsertFirstName" runat="server" Text='<%# Bind("First_Name") %>'></asp:TextBox> ...but I need to be able to do this dynamically in the code ...

Is Microsoft ink and handwriting recognition built into all Windows 7 deployments?

I am trying to add handwriting recognition to my application, I see that with Windows XP the end user needs to have the Tablet PC edition for the recognition to work. However it is a little ambiguous at to the state of Windows 7 users. When I consider the deployment of my application, do I need to test for the Tablet PC edition of th...

How can I remove accelerator characters from a string?

I have a caption for a GUI control, and I want to convert it to a simple text string. Specifically, I want to remove the accelerator metacharacters. For example (examples assume WinForms): Strip off single occurrences of the metacharacter: &Yes becomes Yes Convert double occurrences to single: Income && Expense becomes Income & Expens...

Extension method and type constraints

I am starting to play with extension methods and i came across with this problem: In the next scenario i get a: "extension method has a type constraint that can never be satisfied" Public Interface IKeyedObject(Of TKey As IEquatable(Of TKey)) ReadOnly Property InstanceKey() As TKey End Interface <Extension()> _ Public Function To...

NHibernate with Inversion of Control

This is just something I've been thinking about and was wondering if it exists, or even if its beneficial at all. I'm doing inversion of control and dependency injection using Unity. I'm also doing ORM with fluent nHibernate. I was wondering if there was a way to either configure nHibernate to take interfaces as its type parameters an...

Using EntityDataSoruce and nullable column. How do I set update the column in my db to null?

Can anyone reliably get the EntityDataSource to save a nullable column to the databse as a "null" when bound to any of the controls, such as "FormView"? I have tried using several different UpdateParameters (SessionParameter, ControlParamater, Parameter, etc). I have tried setting "ConvertEmptyStringToNull" to true and leaving the prop...

How do i change the column width of a DataGrid

i'm creating a user control in C# .net compact framework 3.5. And i'm using a DataGrid Control with a DataTable as the DataGrid's DataSource. i need to make some of the grid columns wider. for some reason i can't... i just couldn't find the method or property that controls the column width... any ideas? thanks in advance... ...

Strange behaviour on Win7 embedded machine

Our application (C# .Net 3.5) works fine on WinXP machines (embedded or not). Now we move to Win7 embedded machine. If we put our application under C:\, no problem. If we put our application under "C:\Program Files" directly, we cannot launch it. Windows will popup a "... Stopped working" window. if we first put our application und...