.net-3.5

how to Dynamically invoke Web Services in .Net

I am writing a Web service client in C# which takes the URL of the web Service, and a web method name. I want to check if thew Web method actually receives an int and returns a DataTable, and if this is true, it should call it and return the DataTable. I have found a couple of posts where this is accomplished compiling dinamically the ...

Where to place a Sync() call: FormClosed or FormClosing?

I need to kick off a Sync() process whenever my windows form app is being closed. This sync's data between the local SQL instance and a network SQL instance. What is the better event to place this in: Closed or Closing? Are there any factors that might change it from one to the other, as far as being best practice? As a bonus questio...

Is there a constraint, interface or class that envelops IEnumerable or array?

I'd like to take the following if possible and combine them: public static T[] ForEach<T>(this T[] TArray, Action<T> doWhat) { foreach (var item in TArray) { doWhat(item); } return TArray; } The above handles array, below handles lists public static IEnumerable<T> ForEach<T>(this IEnumerable<T> TList, Action<T> action) ...

dynamicaly loaded controls lose values (ASP.NET)

Hi, I've got a strange problem concerning dynamically loaded controls in a asp.net application. So there is a control where user have to select some items and/or do some text input (textboxes). The control depends on a single dropdown list element. So user A chooses a certain value in this dropdownlist "controlselector" -> on of the m...

Checkboxes in ASP.net MVC (c#)

I'm creating a checkbox list to handle some preferences as follows... <ul> <%foreach (var item in ViewData["preferences"] as IEnumerable<MvcA.webservice.SearchablePreference>) { var feature = new StringBuilder(); feature.Append("<li>"); feature.Appen...

Can I add a linq compiler to my project?

I'd like to allow some of our business analysts to write in linq instead of SQL where applicable. Corporate would never go for allowing linqpad to be installed, so where would I start on learning how to allow say simple linq queries or expressions in vs2008 project? Is there sometype of eval() function for .net that would compile and ru...

Get Requesting Domain Name from WCF request?

I asked this question: http://stackoverflow.com/questions/935854/get-the-domain-name-of-a-wcf-request Is it not possible to get the requesting domain from a WCF request? So for anonymous request that do not require authentication, how can I get the domain name? ...

Alternative To Sessions? (asp.net mvc c#)

I'm being told that the server we're being given to use has 2gb of ram but is nearly maxed out with the current main application that runs on it. But for the site were building, which is wholly reliant on a web service, we need to pass the response to the previous request within a chain... i.e. Page One var stepone = project.webservic...

3.5 SP1 Application Compatability Update (GDR) - Is there a list of known incompatabilities?

3.5 SP1 was released, which also included 3.0 SP2 and 2.0 SP2. All three of these service packs potentially introduced a number of incompatibilities if you were using these versions of any of the frameworks and installed the update. There was a lot of bad press regarding the SP1 update and the number of issues it introduced. e.g. http://...

Running .NET 2.0 & 3.5 web sites in IIS 7

I heard there is a problem or a certain way you must setup IIS in order to run both .NET 2.0 and .NET 3.5 sites concurrently? We don't see a .NET 3.5 option in the dropdown when configuring the site framework. ...

What is the best practise for storing database connection details in .NET?

This might be a duplicate (question) but I am looking specifically for the .NET best practise. How to store database connection strings, username and password etc. in a safe way? Is an encrypted app.config best in most cases? I would also like to be able to set the password in the config file and then have it encrypted as soon as the a...

Distributed Monitoring Service using C# .NET 3.5

Let's say for example you have 5 different companies using the same platform (Windows based) all wrote their own web services, what technique using C# and .Net 3.5 would you recommend using to monitor all their different web services? My intention is to build an application that provides visual feedback on service statuses to site admin...

How do you set the FrameworkElement.Width property to the value of a qualifiedDouble, in the code-behind?

I'm trying to set the width property of one of my controls to a qualifiedDouble, as described here on MSDN. (Scroll down to the "XAML Values" section to see MSDN's info on the use of a qualifiedDouble) However, I want to know how to achieve this in the code-behind, rather than XAML. The UserControls I am creating do not have XAML atta...

The call is ambiguous between the following methods or properties (bug??)

Create a new ASP.NET MVC Web Application Create an ASP.NET App_Code Folder Inside the new folder, create a class with an Extension Method. For example: static public class BugMVCExtension { public static int ToInt(this string str) { return Convert.ToInt32(str); } } Choose a View and try to use this new Extension ...

When does Entity Framework open and close Database Connections?

When I instance my "Entities" object in Entity Framework, and make a couple of queries using that Entities object, what happens to connections? Does it open a connection when I instance the object, and close it when I dispose of it? Or does it open and close a connection for each single query I execute? In either case, is it possible...

how many people have .net framework 3.5 installed?

I am building a .NET application and considering deploying it through XBAP. This requires that the users have .NET 3.0 - 3.5 installed on their machine. Are there any kind of estimates of how many people have this? As a developer it's really hard to estimate. Any thoughts? ...

How can I add a PropertyChangedCallback to a dependency-property of the base class?

I have a class derived from System.Windows.Controls.UserControl, and I need to add a PropertyChangedCallback to the FrameworkElement.Margin dependency-property. How is this accomplished from my C# code? I can't find any good examples of this in MSDN. ...

What am I missing out on by only running .Net 2.0 vs 3.5?

It seems that 3.5 was a big leap from 2.0. My workplace is still stuck on 2.0. What kind of fun am I missing out on by not being able to upgrade? ...

Activator.CreateInstance - How to create instances of classes that have parameterized constructors

Hello all I have read a few bits and bobs online about this topic but found none that work for me. What I am trying to do is create a class of a runtime Type. I use Activator.CreateInstance which works fine for classes with constructors that contain no arguments. For those with arguments it throws an exception, is there a way around t...

Sharing data thru WCF services and aspx pages

My web app exposes a few services (WCF) and I need to load an XML file and 'store' it a static variable visible to the entire AppDomain. That variable needs to be queried and updated from either a service or a page. The thing is, I load that variable in the Application_Start (Global.asax.cs) but when a service request arrives the variab...