.net

How to Update Data Source in C#

I am working on a Windows Form-Based application in Visual Studio 2008 using C# with an Access database as a back end. I added the Access database into the project by going to Data->Add New Data Source and I am able to retrieve data from the database's custom-made DataSet perfectly. My next goal is to save new data back into the Access ...

MethodInfo and Delegates

I am using dotnet 2.0 I know that with an EventInfo value, you can loop through an Assembly's Types and find all the methods that match the EventInfo delegate definition ( EventInfo.EventHandlerType ) Is there a way to find out what available delegates a given MethodInfo can be assigned in the Delegate.CreateDelegate() function without...

Problem accessing .NET web service from Windows app

I have an AJAX web application. ASP pages are accessing various Web Services that are part of the application using standard Microsoft .NET AJAX extension APIs. Now, I have to call some of the web services from the Windows app. It works when I add web reference to a project on my local development machine. But when I try to access web...

Producer Consumer queue does not dispose

Hi, i have built a Producer Consumer queue wrapping a ConcurrentQueue of .net 4.0 with SlimManualResetEvent signaling between the producing (Enqueue) and the consuming (while(true) thread based. the queue looks like: public class ProducerConsumerQueue<T> : IDisposable, IProducerConsumerQueue<T> { private bool _IsActive=true; pu...

Help with using jQuery with ASP.NET MVC

My app has a "Show all comments" similar to the one in Facebook. When the user clicks on the "show all" link, I need to update my list which initially has upto 4 comments with all comments. I'll show some code first and then ask some questions: jQuery: ShowAllComments = function (threadId) { $.ajax({ type: "POST", ...

A program does not work on one of the vmware servers. Any tips on how to find the problem are appreciated. Details inside

The VB.NET exe runs fine on one of the VMware servers but gives the following message on the clone of the same. There are no event entries and the program does not even start. Its running on Windows server 2003. Any thoughts on how to debug/tackle this? [Program Name] has encountered a problem and needs to close. We are sorry for the i...

Code generator to create ADO.NET SqlParemeter array from stored procedure inputs?

I have SQL Server stored procedures which have several inputs. I want to save time from manually creating C# ADO.NET sqlParameter arrays as in sqlParameter[] sqlParameters = { new SqlParameter("customerID", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, string.Empty, DataRowVersion.Default, custID) ....... ...

Substring error though not using substring.

I have the following code: public static long CreateVendorsEmailJob(List<Recipient> recipients, string subject, string body) { long emailJobId; using (var connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString)) { connection.Op...

Execute Selenium 2 Tests Against Remote Browser

I'd like to have a configuration where my build server runs a NUnit test that opens and drives a browser on a remote machine. What would be the best way to accomplish this? It was easy to do in Selenium 1, because the java proxy server sat between your tests and the browser. In Selenium 2, your tests communicate directory with the brow...

When I publish a ASP.NET MVC 3 project my Razor views aren't copied.

Looks like Publish doesn't copy Razor views at ASP.NET MVC 3 Beta. Is it a known limitation of Beta? Will it be fixed at release? ...

How do i force a wpf window/control refresh of disabled elements

I was pulling out my hair trying to figure out why the normal Dispatcher.Invoke command did not work for redrawing my window, but now I the issue seems to be related to the content being disabled. I'm using the Dotnet 4.0 full framework. If i use private void DoSomething() { HandleBusyEnableDisable(false); DoSomethingThatKeepsItB...

Html.TextboxFor default value for Integer/Decimal to be Empty instead of 0

Hey everyone, I am using the default asp.net MVC 2 syntax to construct TextBox's which are integer or decimal for my asp.net MVC web app: <%: Html.TextBoxFor(model => model.Loan.InterestRate) %> pretty straight forward, but the problem is inherently of the fact my binding model objects are decimal or int and non-nullable, they print ...

entity framework - how can I implement this SQL in the abbreviated EF linq

Can anyone help out with what the C# code would be to implement this SQL as Entity Framework Linq in the abbreviated form? (e.g. where you have the "." notation such as xxx.where(... etc) SELECT PN.Name, Sum(U.Amount) FROM Usages as U, ProcessNames as PN WHERE PN.Id == U.ProcessNameId AND U.Datetime BETWEEN '2010-01-08' AND '2010-1...

Opening an explorer window with designated file selected

Hi Guys, I have an application which has an option to show the selected selected file in the folder in which the file resides. My question is, how do I achieve this? To clarify, if a user in my program selected the "Test.txt" file, then I want a Windows Explorer window to pop up and highlight the file the user selected. You can see sim...

Splitting strings in a "Google" style way

I am trying to create a function that will split a string into search terms. Using this code will work fine: string TestString = "This is a test"; string[] Terms; Terms = TestString.Split(" "); This will split my string into 4 strings: "This", "is", "a", "test". However I want words that are enclosed in quotes to be treated as one wor...

How to create Package in mono 2.8 its need 'mono.exe'

Hi, I am using "Mono Tools for Visual Studio - 2.8". When I am creating Package of mono it requires 'mono.exe' but it does not exist on my system. How can I get mono.exe OR there is any other way to make Package for the Linux. I want to run my windows application on Linux and Mac. ...

MakeSfxCA.exe and DLL compiled with Framework 4.0

...

Visual Studio Post Build Task passing Multiple files

I have an executable file - process.exe - which takes a single file path and does something with that file (no outputs). process.exe isn't capable of accepting wildcard paths e.g. process.exe c:\project\*.ext What I want to do is select all files of a particular extension in my project (*.xmlt) and pass each one of these files into the...

Invalid XML characters

I have a text file(UTF-8) file. Content of this file is extracted form rich text documents, it might be MS Word, PDF, HTML or any thing. I have to pass this content to a web service, but most of time it contain invalid characters like form feed or null. What happens now is when I pass the content of the file, containing invalid character...

Adding and saving not persistent objects to persistent object in NHibernate

Could someone explain this for me? I have standard relations in my MSSQL DB: [item] id symbol [item_version] id item_id (fk) symbol In [item] mapping there is a standard item_version BAG with cascade="all" and many-to-one in [item_version] mapping. This is the test case: [Test] public void AddNewVersionToPersistentObject(...