.net

CLR detected an Invalid Program

Need any help, ideas to figure out this issue. We are working on an application that makes a call to SAP for posting some data using ERPConnect. We encounter the following issues in one of our Entity Framework call in our WCF service. We are using .NET4.0, Win 2008 Server. The following information was included with the event: excep...

Writing a better natural sort (than mine)

I added an answer to this question here: Sorting List<String> in C# which calls for a natural sort order, one that handles embedded numbers. My implementation, however, is naive, and in lieu of all the posts out there about how applications doesn't handle Unicode correctly by assuming things (Turkey test anyone?), I thought I'd ask for ...

.NET: Is "foreach" command?

Hello, I have just a terminology question. I have read that if, foreach etc. are statements but what does it mean in the terminology - are these commands? It is maybe "lost in the translation" problem ...

Changing the default behaviour in Visual Studio when autogenerating code for binding to an event.

Usually when I subscribe to an event, I use the Visual Studio builtin function to generate the method. So if I want to bind a clicked event to a button after I write += I click tab one time to generate the code after +=, and then tab again to create the empty method associated with this event. So for a button clicked event, I will end u...

SQL Script help

I have a table like this named "Days" Day 1 Day 2 Day 3 Day 4 Day 5 Day 6 Day 7 1 1 1 1 0 0 0 1 1 1 1 0 0 0 which has the corresponding details. Where 1 is 'true' and 0 is false. DaY 1 - sunday day 2- monday day 3 - tuesday day 4- w...

Can i use K2 Blackpearl without SharePoint ?

is it possible to develop a solution using .NET technology along with a the K2 Blackpearl BPM but without using Microsoft SharePoint ? ...

C#: Using Watin.Core with another user (ProcessStartInfo), IIS returns not authorized

My situation: I'm running a C# testing program which allows me to configure certain browser "steps", like going to an URL or clicking on a button. There's also the posibility to enter a domain, username and password. When running the program it will invoke another program* with the (if entered) username and password. This new program wi...

DateTimeFormat Issue

I dont get following desired output from a DateTime-Object: 2010-03-29 13:15:00 My default localization is de-DE, so a simple ToString gives me: 29.03.2010 13:15:00 What I've tried is to create a DateTimeFormatInfo Object from US-Culture and use its DateTimePatterns but without success: Dim usDateFormat As Globalization.Date...

Windbg with SOS, How to dump a c# struct

How do I dump a struct using windbg, is there a dumpstruct command similar to dumpobject? Or can dumpobject dump structs aswell? ...

NHibernate multiple references to the same record from a single object

I'm using Fluent NHibernate and the setup I have is as follows: An Address object, which is a simple list of address fields. A Company object which has two references to address objects, MainAddress, InvoiceAddress. The problem I'm having is that on occasion both MainAddress and InvoiceAddress may refer to the same record in the Addre...

Shorten a VB.NET array declaration ?

Question: How to shorten this array creation ? I need to create an array of type ReportingService2005_WebService.Property with one property. Something like: Dim PropertyArray() as new ReportingService2005_WebService.Property(1) I have to do this: Dim PropertyArray As ReportingService2005_WebService.Property() = New Reportin...

VB .NET : DataGridView.DataMember throws error when assigned a two-part name. i.e. Sales.StoreContact

My problem is oulined here: http://support.microsoft.com/kb/314043 Microsoft says: "This behavior is by design." No workaround is provided. I need a workaround. So I have a dataset which is populated correctly with the contents of the table name Sales.StoreContact. When I try DataGridView1.DataMember="Sales.SalesContact" the IDE th...

VB.Net: How to use an Object data source in report (.rdlc)

My question is similar to this one but I'm having some problems with the actual implementation. I've got a report (.rdlc) in the business layer of a 3-tier app. I've got an object in the BL (EmployeeManager) which has a GetEmployees(Expression as Expression(Of Func(Of Employee, Boolean))) As IQueryable(Of Employee) method. As I didn'...

WCF REST throws HTTP 400 error maxstringcontentlength quota (8192) exceeded

Based on this post http://stackoverflow.com/questions/2257808/error-calling-a-wcf-rest-service-using-json-length-quota-8192-exceeded I experienced the same problem when calling my WCF REST Service (hosted on IIS 7) from a console application (using Microsoft.HttpClient library). I have increased the maxStringContentLength="2147483647" o...

what sort of code which we could write in Page_PreRender event only???

hi... I google about Page_preRender that how can we use Page_PreRender rather than page_Load or what could be the scenario where we could not use page_Load and have to use Page_PreRender but every place I find that, "The point at which the objects are prerendered is the last time changes to the objects can be saved or persisted to vi...

Unusual interview question

College friend told me about interview question that is asked in one company: Write reasonable(=compilable) method declaration that contains as many C# keywords as possible. If there are 2 or more the same keywords they are counted as one. Method's body is not considered. C# has finite number of keywords so such me...

How to attach popup winform at main form's custom postion ?

Hi, I have a C# winform main application running hosting main form. now i want to popup a small winform to show some status but it should lock itself to mainforms to the center of title bar. now I want it to stick there for some duration till i close it from code. it should not take focus (i guess it is not mdi so this should be default...

.net C# opc-client

I want to write opc client for server. And dont want use big libraries. can i do it witn .net libs? smth like adding reference to opcautomation? but i cant find it in vs2010. thx! ...

Entity Framework with multiple edmx

Let's say I have in my database multiple db schema for example : HumanRessources and Inventory. In each of those schema contains multiple tables. Do you usually split your DB into multiple edmx or usually just put everything in one single edmx? I was thinking about creating a edmx for each schema, but wondering how this will impact a u...

Get path of Outlook PST file without using Microsoft.Office.Interop.Outlook

I found several web pages explaining how to get the path of Outlook PST files, but they all use Microsoft.Office.Interop.Outlook. I'd like to avoid a dependency to Office interop assemblies, as they're different for each Office version. Also, this technique is very slow if Outlook isn't already started (since it creates an instance of Ou...