.net

"Unrecognized configuration section connectionStrings" in app.exe.config

Hi On a Terminal Server install of my .NET 2.0 WinForms app, one of my clients gets the following exception on startup: "Unrecognized configuration section connectionStrings" This is occurring in myapp.exe.config but I can't figure out why. Runs perfectly everywhere else, only difference between this install and any other is the connect...

How to show hierarchial data in a dropdownlist

I have a table in SQL Server 2005. I want to show all domain name in a dropdownlist maintaing the same hierarchy. i.e Law Engineering --civil --Mechanical Medical --Dental ----Cavity --MBBS I need to append '--' according to the domain level. Is it possible using a sql query. or alternatively can I have any other ...

Array.BinarySearch where a certain condition is met

I have an array of a certain type. Now I want to find an entry where a certain condition is met. What is the preferred way to do this with the restriction that I don't want to create a temporary object to find, but instead I only want to give a search condition. MyClass[] myArray; // fill and sort array.. MyClass item = Array.BinaryS...

Different kinds of doubles in vb.net?

Hey all- I'm using QBFC to generate invoices in a Quickbooks integrating app. I'm getting an exception thrown for lineItem.Amount.SetValue(val as Double) when I try to enter a programmatically generated double. The following does not work: lineItem = invoice.ORInvoiceLineAddList.Append.InvoiceLineAdd Dim amount as Double amount = s...

SuppressUnmanagedCodeSecurity At Class Level

If I add the [SuppressUnmanagedCodeSecurity()] attribute to a class, is it equivalent to adding it to each function in the class? ...

Sync Framework: Why can't I sync all data from tables that were added to the SyncProviders?

Hi guys, I just kind of confused as to why I can't get to sync all expected data in one sync session. When I try to sync to the central database through WCF services, I only get partial sync, then there are still some data left that were not synched. So I still need to resync. Is there an explanation why I can't get all expected data i...

c# Generic List

I m populating data for different entities into set of lists using generic lists as follows : List<Foo> foos .. List<Bar> bars .. I need to write these lists to a file, i do have a util method to get the values of properties etc. using reflection. What i want to do is: using a single method to write these into files such as: void w...

Accessing the project system from a Visual Studio MEF Editor extension

I'm writing a Visual Studio editor extension using the VS 2010 SDK RC. I'd like to be able to figure out what the references of the current project are. How do I get access to the project corresponding to the current editor? The documentation on editor extensions doesn't seem to include information on how to access non-editor parts of...

Does the Validation Application Block in Entlib 5.0 support client-side validation?

VAB used to be just server-side bur does the new version of Entlib allow client-side validation for VAB? ...

Checking Available Memory allocation in C#

i need to create a function in my application to set its available memory usage. What i want to do is when the application is running, and it reaches to the set memory settings, i'll have to switch from saving to the memory to saving to a file to the local drive to avoid application hang. Is this a better way to do? What things to consid...

Pros and Cons of automating Excel using VBA vs .Net

I've been tasked with creating a financial planning tool in Excel that would benefit from some custom functions/macros. My initial reaction was to use VBA. I've used it to drive Excel before (say 5 years ago). But I then began to wonder if I would be better off using VSTO. Has anyone has experience using both techs and can list the pro...

How to secure licensekey generation

Scenario, simplified for brevity: A developer creates an application for a customer. The customer sells this app to end-users. The app requires a license key to run, and this key is generated by the customer for each end-user with a simple tool created by the developer. The license key contains an expiry date for the license and is encr...

write application event information with Win32 API

.NET provides EventLog class that be able to write application event information to a particular log on the system. Is there simliar Win32 API that can be called with C++? ...

How can I schedule tasks in a WinForms app?

QUESTION: How can I schedule tasks in a WinForms app? That is either (a) what is the best approach / .NET classes/methods to use of (b) if there is an open source component that does this well which one would be recommended. BACKGROUND: Winforms app (.NET v3.5, C#, VS2008) I'm assuming I will run the winforms application always, an...

Weird - "The EntityReference object could not be serialized" when serializing from an ASP.NET Web Site, but works OK on an ASP.NET Web Application

I have an Entity Framework data model. Part of the model is a Customer entity. The web service provides a method to get a customer, and to receive an updated version of this customer to be persisted. To test this, I created a new ASP.NET web Application, (Solution > Add > New Project > ASP.NET Web Application), then added a reference ...

Create an XML file using Datasets Using info from XML Schema

Hello there, I have been thinking about the optimal way to create an XML file using data from a Dataset AND according to the rules of an XML schema. I've been searching around for a bit, and I failed to find a way in which I only take the data from the Dataset and put it inside a XML tags, with the tags being defined by an already-exist...

Show Google Analytics dashboard on my site

I have an ASP.NET website set up, and I'm using Google Analytics for page tracking. The only thing I don't like is that I have to go away from my site (to the Google Analytics site) to see the report. Is there any way to show the Google Analytics data on my own site with all the AJAX that they have? ...

Events raised by BackgroundWorker not executed on expected thread

A winforms dialog is using BackgroundWorker to perform some asynchronous operations with significant success. On occasion, the async process being run by the background worker will need to raise events to the winforms app for user response (a message that asks the user if they wish to cancel), the response of which captured in an CancelE...

How can I run some common code from both (a) scheduled via Windows Task & (b) manually from within WinForms app?

Hi, QUESTION - How can I run some common code from both (a) scheduled via Windows Task & (b) manually from within WinForms app? BACKGROUND: This follows on from the http://stackoverflow.com/questions/2489999/how-can-i-schedule-tasks-in-a-winforms-app thread REQUIREMENTS C# .NETv3.5 project using VS2008 There is an existing funct...

Adding ObsoleteAttribute to (or otherwise greylisting) Types not under my control?

Is there a way to somehow mark Types I do not control as Obsolete? Basically I would like to add ObsoleteAttribute to types I do not want to use in my .net Project (i.e., SerializableAttribute) I believe I can do something like that with FxCop, but ideally I would like to have the compiler already generate warnings for "greylisted" Type...