.net

Referencing web project from ironpython

i've got an mvc project written in C#. i'm trying to reference it from ironpython. i've got no issue importing the objects and referencing the dll, but some of the objects rely on connection strings from the web.config, is there any way for me to reference the dll and then specify the web.config it should be using? ...

Reverse selecting text programmatically in a richtextbox (vb.net)

Hi, I have a form with a richtextbox and a scrollbar. I want to be able to keep appending text to the textbox without loosing my selection. I can save the selectionstart and selectionlength before I append the text and set it back and it works. The problem is when it comes to reverse selecting. The best I could do is set back the selecti...

.NET setup projects using Visual Studio 2008

When you create a Setup project for a Windows/Console application, you find that there are two outputs. Setup.exe .msi What does setup.exe and .MSI do? Which one should be used for installation? I have seen that I can install the application using both. But Setup.exe is fairly small file compared to the .MSI file. Questions If I...

How to Consume WCF Service with Android

Hi, I am creating a server in .NET and a client application for Android. I would like to implement an authentication method which sends username and password to server and a server sends back a session string. I'm not familiar with WCF so I would really appreciate your help. In java I've written the following method: private void Log...

Does ClickOnce support deployment of applications to clients behind a Proxy that requires authentication?

With all the advantages of ClickOnce, we would like to use it as the deployment mechanism for our App. However i have found this message in Microsoft Connect where it says that ClickOnce fails with proxy authentication. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115468&wa=wsignin1.0 So does th...

Killing a process on exit

My project has an object that creates a process. It this object's Dispose function, it kills the process (or tries to). However, if the program crashes, it leaves the process running and doesn't clean up. Which causes the program to fail next time because it tries to launch the process again and can't get a lock on it. How can I make su...

Programmatically printing directory of word documents... last file always skipped.

I am having a problem when trying to programmatically print a directory of word documents. In this example, I am trying to print only the files with the "3_" prefix. The problem is that the file does not print unless there are two files with the 3_ prefix. I have been looking around forever to figure this problem out. Is there someth...

Getting hash of a list of strings

I would like to write a function GetHashCodeOfList() which returns a hashcode of a list of strings regardless of order. Given 2 lists with the same strings should return the same hashcode. ArrayList list1 = new ArrayList() list1.Add("String1"); list1.Add("String2"); list1.Add("String3"); ArrayList list2 = new ArrayList() l...

Does anybody know a real life example of IronRuby usage

Although I'm not a .NET developer I always get excited about the work DLR team is doing at Microsoft. I watched a couple of videos from various Ruby conferences where John Lam showed the progress of IronRuby and Dynamic Language Runtime in general. The latest video I saw is from Ruby conf: http://rubyconf2008.confreaks.com/ironruby.html ...

ConvertEmptyStringToNull property

Hello, A) public void GetEmployee( int EmployeeID ); <asp:ObjectDataSource SelectMethod=”GetEmployee” …> <SelectParameters> <asp:ControlParameter Name = ”EmployeeID” ...> </SelectParameters> If for whatever reason EmployeeID parameter is NULL, ObjectDataSource will convert Null to zero and passed it as argument to GetEmpl...

Reusing SqlCommand ?

I am not really sure if it is possible or not. I am currently working on the college project and i have a function that uses stored procedure. I would like to know if it is possible to take same SqlCommant apply updated parameters and call to the stored procedure again withing same function. Lets say i have something like that in my cod...

Duplex MSMQ Channel ?

Hi, I'd like to be able to use duplex contract with MSMQ, does someone have any ideas to do that ? I've seen some blogs here and here, but it seems that their attempt (using duplex contracts over MSMQ using a:ReplyTo) has not successed. Reliable session cannot help me because it doesn't garantee that the message will be sent when the n...

Path.Combine absolute with relative path strings

I'm trying to join a windows path with a relative path using Path.Combine However, Path.Combine(@"C:\blah\",@"..\bling") return "C:\blah..\bling" instead of "C:\bling\" Does anyone know how to accomplish this without writing my own relative path resolver (which shouldn't be too hard)? I know it seems stupid to ask for code to simple t...

Class in the BCL that will event at a given DateTime?

Is there an object that will event at a given DateTime or DateTimeOffset? I am using a Timer to do this operation now but it requires a bit of calculation on my part, was just thinking there might already be something in place. ...

mscordacwks.dll and mscorwks.dll confusions

What are the different functions mscordacwks.dll and mscorwks.dll performing in .Net framework runtime, build and in debugging process? Are there any recommended readings for this topic? I have searched for quite some time but failed. thanks in advance, George ...

Preference to one match in Regex when overlapping matches exist?

I have a regular expression that matches x OR y condition. Sometimes those matches overlap and I want to give preference to one of the conditions. Here is my test case. Regex: X[^\w]*\>|\>[^\w]*X Input: Soup > X > Alphabet Alphabet Soup > X X > Alphabet Soup Matches: The first highlighted match (yellow) should be X...

How can I solve a connection pool problem between ASP.NET and SQL Server?

The last few days we see this error message in our website too much: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." We have not changed anything in our code in a while. I revised ...

What is the upper limit of WorkflowInstances that I may have instantiated at one time?

Is there an upper limit on the number of instances of WorkflowInstance I may have running at one time? I am using .Net 3.5 and C# (not that the language should make a difference.) Please note that I am not suggesting that it is a good design to many running at once, I am simply curious about the upper limit, if one exists. ...

What actually causes Session_Start to be called?

In a little demo application that I'm building I put code to initialize the database in the Global.Session_Start() event. However, I notice that this event does not fire when I'm running through the app in the debugger on the development server (haven't tested it anywhere else yet). Question 1: What gives? When does Session_Start() ac...

LINQ to SQL vs ADO.Net

What's the difference between LINQ to SQL and ADO.net ? ...