.net

Word menus are stuck after closing a document with COM

The following code opens and closes a Word document using COM; it does not produce any errors. However, if prior to running the code Word was maximized then the Word menus do not react to mouse or keyboard actions after the program is run. public static void Main(string[] args) { try { var wordDocument = GetWordDocumen...

ASP.NET GridView - How to Perform Custom Update Statements?

Hi Guys, I have an ASP.NET GridView which displays a list of neighborhoods. I wish a user (administrator) to be able to edit the neighborhood name. Now, the database is quite complex, and as such, i can't simply provide an UpdateCommand / SqlDataSource for the GridView. I bind the data manually (on first load, and on the PageIndexCha...

iterate an Ilist and insert to table

I've an IList with 5 items. I need to insert these, looping one by one, from the list to a SQL Server table using ado.net. I am using IReader(enterprise library) How can I do this? ...

SFML.NET particle system

I've written particle systems before and, put simply, it's more effort than it's worth given the size of the projects I want it for. What I'm ideally looking for is a particle system which can be easily dropped into an SFML.NET project without needing a great deal of manual integration. Does anything already exist to fill this need (ide...

What is the fastest method for rotating an image without clipping its edges with GDI+?

The title says it all. There are some looooong and hungry algorithms for doing so, but as of yet I haven't come up with or found anything particularly fast. ...

Random numbers and thread local storage

The accepted answer to this question, and a similar discussion at work today got me to wondering about something. The question was about how to safely generate random numbers in a multi-threaded program. The accepted answer advocates using thread local storage, effectively creating one random number generator per thread. I wonder if t...

Windows Phone 7 target display resolution - recommendations?

The official WP7 emulator uses 800x480 resolution. The only info I can find on planned WP7 phones (eg Samsung Cetus i917) share the same resolution. While I realise the appeal of writing resolution-independant programs, I'd really rather focus on pushing a known set of hardware to the max than sacrificing features and efficiency for one-...

Linq Query after Where statement not returning relationship data

public List<Store> GetAllFriendsTopStores(long uid, List<long> users) { using (var entities = new myEntities()) { var v = entities.DbUsers .Where( x => users.Contains( x.uid )) .Stores // i can't select stores here? Why is this??? } } In this case Stores is a navigation property... I need to be ...

How do I retrieve the HTML of a webpage in C#?

Possible Duplicate: How can I download HTML source in C# I want the source HTML of the webpage so I can parse it in my C# program. ...

How can I dumb down our cutting-edge Text-to-Speech?

Back in the old days, text-to-speech, as cutting edge as it was, was very imperfect. When you typed in a word, it would pretty much read it how you spelled it... in monotone. Oftentimes, the result would be very funny. Nowadays, Text-to-Speech is too intelligent to goof in ways that can bring a laugh. As a personal project, I'd like ...

this method cannot be translated into a store expression

I have a bunch of Linq to Entity methods that had the same select statement, so I thought I would be clever and separate that out into it's own method to reduce redundancy... but when i attempted to run the code, i got the following error... this method cannot be translated into a store expression Here is the method i created... ...

How to read images in .NET?

What API or component could I use to read images (e.g. scanned copies) using C# and .Net? ...

Get a processes Private Working Set memory

Hi all, Trying to programmatically get the private working set of a process. Currently I am able to get the working set without issue but having trouble getting the private working set. Here's method: private void GetProcessesForServer(string serverName) { var runningProcesses = new Process[0]; try { runningProc...

is "the located assembly manifest definition does not match" the coming back of dll hell ?

I heard that with .NET the so-called "DLL Hell" would go away, now there is this other error http://blogs.msdn.com/b/junfeng/archive/2004/03/25/95826.aspx The located assembly's manifest definition with name xxx.dll does not match the assembly reference In my case I just got this error except it does even indicate name xxx.dll...

which is faster for running SQL on small tabular data (250 records), XML or SQL server?

I'm working on a small standalone .NET app needs to refer to some tabular data and its only just selects and at most these tables have 250 records. Previously developers have used a SQL server database. Would i get a performance advantage if i simply convert the table data to XML and read from that? Also is there any kind of performanc...

Prevent numbers from being pasted in textbox in .net windows forms

I have prevented numbers from being typed in text box using key down event. But when using Ctrl+V or pasting content through mouse, the numbers are being entered in the text box. How to prevent this? I have to allow all text to be pasted/typed except numbers. ...

How to give dynamic DataSource name in App.config

I am reading excel file and for that I do have connection string in App.config but I want to read each day the excel which is today's excel.. Each excel name is today's date(MM/dd/yy), so datasource name is somewhat dynamic. how to write the connection string in App.Config then I want to use something like <add name="Excels" connectio...

How to change the Header Text of Gridview after Databound?

I have a gridview I bound a DataTable with that Gridview Its dynamic so no hardcode Text in desin. I tried to change it after Databound and in PreRender of gridview but no Success. Actually there are Underscores('_') in text and I want to Replace it with space. Below is code <asp:GridView ID="grdSearchResult" runat="server" AutoGener...

multi-column, editable TreeView in WPF

Yeah I am looking for some C# code of a multi-column TreeView where each cell can be inline-edited and also dragging the rows is supported. Do you have any good examples of such a custom component? ...

.NET assembly information at runtime

I want to get information of assembly (classes in the assembly, methods and properties). The name of assembly will be entered through text box. For this i did like Assembly ass = Assembly.Load("System.Web") but it did't work. Sombody have solution for this? ...