.net

Install (activate) .NET 3.0 Framework with an application in Vista

if i have an application that requires .net 3.0, what is the proper way to make an install file out of it, that will install the application and then install (activate) the .net 3.0? i tried publishing my project through visual studio 2008 (c#) which created the installer and the .net activator, but it didn't work properly on computers o...

C++ To .Net

Hello, I'm learning C++, but i see that .Net is a very nice framework, then i want to ask: "It's difficult to develop in .Net?", remember that i have some knowledge of VB and Delphi. I'm using Windows Vista Ultimate. Thanks! ...

C# Windows Form disappears suddenly!

Hello everyone, I am using C# + VSTS2008 + .Net 2.0 to develop a Windows Forms application. In button1 event handler of Form1, I create Form2, then Form2 appears. Then when trigger event handler of button2 of Form2 (button2 is Form2's UI button element), after executing button2 event handler, Form2 will disappear. Here is part of my cod...

Silverlight 3 Offline Mode

Has anyone found that the userbase is more reluctant to install Silverlight 3 Apps in offline mode because they have no control over "where" the app is installed to? I've had a few issues of a similar nature in the past, with 'power users' getting upset that they can't specify install directories. Are there any workarounds? Any way to...

How would you write Gorillas in .NET?

I remember a QuickBasic program (named Gorillas) where there was a monkey who would toss a banana, I believe at another monkey. I want to write this in .NET to learn some. How would I get started doing that? ...

WPF listbox item not wordwrapping

My list box has, amongst other things a description field in it which can be quite long. Instead of having a horizontal scroll bar I want to word wrap it. It works if I set the MaxWidth but since the ListBox changes size I don't want to hard code the value. What's the best way to do this? EDIT: The description is in a TextBlock. Simpl...

Why does my XPathNavigator always return the Root?

I suspect I am missing something basic but vital but because of it my XPath navigator is always returning the root. I have some XML data like so: <?xml version="1.0" encoding="utf-8" ?> <language> <header> <about>about</about> <faqs>faqs</faqs> <feedback>feedback</feedback> <submitblog>submit a blog</submitblog> <...

Why is there no Sort for IList<T>?!?! (edited)

I was pretty surprised when I discovered that there is no direct way to sort or perform a binary search on an IList< T >. Just like there are static methods to sort and perform a binary search on an Array, I think that it would be awfully helpful to have similar static methods that take an IList< T >. Currently: class Array { stat...

Synchronising databases SQL Server via C#

How do I synchronise a database on one server to the other? I need to do it via C#, not scripts. I was planning to use ADO.NET to retrieve the schema and dataset from one database, but how do I sync it in code? Thanks ...

Sql Connection in SSIS Package through Webservices

Hi I have SSISpackage which is developed in VS2008/SQL2008(Target Database),My source data is SQL2005. This package is execute with in the .Net framework of webservice. while executing am getting error with SOURCE Connection (with provider=SQLNCLI10 in connection string) getting error,the description as follows. Description: SSIS Erro...

How to debug "Wrong number of arguments or invalid property assignment" vbscript .NET interop

I have a .NET assembly, written in C#. It's marked ComVisible, has a guid, is signed, regasm'd (/codebase). I did not formally define an interface for the COM part. I use this assembly via VBscript. There's an overloaded method - one form takes a single string argument, and the second takes two strings. Both return another .NET type...

Passing by ref?

I am still confused about passing by ref. If I have a Cache object which I want to be accessed/available to a number of objects, and I inject it using constructor injection. I want it to affect the single cache object I have created. eg. public class Cache { public void Remove(string fileToRemove) { ... } } public class O...

Invalid Operation Exception from C# Process Class

When I use VSTS debugger to see the properties of instance of class Process, many of the properties are marked with InvalidOperationException. Why? Am I doing anything wrong? I am using VSTS 2008 + C# + .Net 2.0 to develop a console application. Here is my code: System.Diagnostics.Process myProcess = new System.Diagnostics.Pro...

Is this a bug in dotnet Regex-Parser?

I just wrote a regexp to do a basic syntax checking if a string is a valid math formular. I just define a group of valid chars and check if a string matches (I shortend the regex a little: private static readonly String validFormuar = @"^[\d\+-\*\/]+$"; private static bool IsValidFormular(String value) { return Rege...

How to test if a file is fully copied in .NET

I am monitoring a folder for new files and need to process them. The problem is that occasionally file opening fails, because system has not finished copying it. What is the correct way to test if the file is finished copying? Clarification: I don't have write permissions to the folder/files and cannot control the copying process (it's...

.Net vs Java Jobs

When I do a job search for a .Net developer it's all mostly the same stuff .Net, ASP, SQL Server, CSS, Javascript, AJAX, and maybe C#. Whereas with Java you may have to have Java, Sturts, Spring, JSF, EJB, a RDMB, Eclipse RCP, CSS, Javascript, AJAX, Rest, any number of specific Java APIs. Is it easier to be a .Net developer since the tec...

Can't assign TreeNode to Treeview.SelectedNode

private void WalkerRefreshNode(bool refreshAllNodes) { TreeNode selectedNode = tree.SelectedNode; TreeNode bufferedNode = (TreeNode)selectedNode.Clone(); if (SelectedNode.Tag != null) { DataRow tag = (DataRow)selectedNode.Tag; if (tag.Table.TableName == "example") ...

Invoke with timeout

We have some code running in a background thread which needs to pop a dialog or some other user interaction, so we do the usual Invoke call on to the UI thread: Control.Invoke(SomeFunction); void SomeFunction() { ... } But, we came across a bug, our UI thread is sometimes not immediately responding to the Invoke call - we tracked i...

Adding .net dll dependencies to a project

Hello all, I'm creating .net websites against a CMS server using the API of the software vendor. The problem is that for every version of the CMS software I have different DLLs (mostly unversioned) that I have to deal with. So, right now I am building some reusable server components that depend on these DLLs, but since I want to use ...

Alternative to static class for stateless objects

Hi, For the last year or so I have followed the idea that if a method could be static, to make it static, as this can have a performance benefit, and I have therefore ended up with some static classes in my applications. I have since learned the performance benefit is not often large enough to be worthwhile, and also the distinction th...