.net-3.5

How to hide the caret in a RichTextBox?

Just like the title: I've searched the web for an answer, but i was not able to find a way to hide the caret of a RichTextBox in VB.NET. I've tried to set the RichTextBox.Enabled property to False and then change the background color and foreground color to non-grey ones but that did not do the trick. Thanks in advance. ...

What are the issues with running WPF across multiple AppDomains on one UI thread?

We are looking at creating a WPF UI that runs across multiple AppDomains. One of the app domains would run the application while the remaining AppDomains would host a series of user controls and logic. The idea, of course, is to sandbox these User Controls and the logic away from the main application. Here is an example of doing this us...

Loading relations in linq2entities automatically

When i have a relation between two entities in my model: [GroupMember] (*) ----- (1) [User] and tries to select items from this relation with LINQ: From entity in _user.GroupMember select entity I always get an empty result unless I load the relation first with following statement: _user.GroupMember.Load() Is there a way to avoid l...

What is the root cause of a .NET 3.5 Windows Service having its Number (#) of GC Handles constantly growing?

I have a C# Windows Service running on the .NET Framework 3.5 that is exhibiting a constantly growing number of GC Handles (seen using System Monitor on Windows Server 2003). I have ensured that all resources are disposed of correctly, and have no Finalisers in my code. The 'Large Object Heap size', and '# Bytes in all Heaps' are compa...

Entity Framework mapping

Has anyone a good sample for a "real" mapping scenario with Entity Framework. Not one of that simple Table <-> Entity one ;-) ...

CascadingDropDown in a DotNetNuke module => [Method error 500]

I'm creating a DotNetNuke 4.x module, and need an AJAX CascadingDropDown in my module. I have it defined as follows... <asp:UpdatePanel runat="server" ID="CascadingDropDowns"> <ContentTemplate> <asp:DropDownList runat="server" ID="SelectGroupDropDownList"> </asp:DropDownList> <ajax:CascadingDropDown runat="s...

Execute a stored procedure in Entity Framework from within an ADO.Net DataService

I am using ADO.Net DataServices to expose an Entity Data Model to Silverlight. The model has a stored procedure that returns void. I want to call this procedure from the Silverlight client. My understanding is that I should add a [WebInvoke] method to the DataService class and use DbCommand to call the stored procedure. Here is my co...

How to detect if an aspx page was called from Server.Execute?

I have the following example page structure: Webpage.aspx Script.aspx If I call Server.Execute("Script.aspx") from Webpage.aspx, how can I detect in Script.aspx that it was called from Webpage.aspx and not directly from a web browser? I've tried checking the Referrer but this only seems to return domain and not the script. I'm usin...

Generic methods and multiple constraints

I have a generic method which has two generic parameters. I tried to compile the code below but it doesn't work. Is it a .NET limitation? Is it possible to have multiple constraints for different parameter? public TResponse Call<TResponse, TRequest>(TRequest request) where TRequest : MyClass, TResponse : MyOtherClass Thanks! ...

OutOfMemoryException On Mobile Device

I'm developing an application that uses a mobile device to take a photo and send it using a webservice. But after I've taken 4 photos I am getting an OutOfMemoryException in the code below. I tried calling GC.Collect() but it didn't help either. Maybe someone here could be give me an advice how to handle this problem. public static Bitm...

What is the upper limit on the number of open sockets i can have in win2003 server

Hi. i'm building a chat server with .net i need to know is there a limit on the number of open sockets i can have on windows 2003 server box Also, i tried opening about 2000 client connections and my linksys WRT54GL router (with tomato firmware) drops dead each time. The same thing happens when i have several connections open on my Azur...

Making a Non-nullable value type nullable

I have a simple struct that has limited use. The struct is created in a method that calls the data from the database. If there is no data returned from the database I want to be able to return a null, but Visual Studio complains, Cannot convert null to PackageName.StructName because it is a non-nullable value type. How can I make it nul...

Button BackgroundImage Property

I am trying to write an application on Windows Mobile but I am experiencing a problem. I want to draw a picture of arrows on the button but I do not know how to do this. How can I accomplish this? ...

How to use Dotnet 3.5 dll in C#2 project?

I have a donet 3.5 dll which I want to use in my old C#2 project, currently I don't want to upgrade the C#2 project. I added the dll as a reference in the c#2 project and everything was wokring fine. The problem appeared when I want to use method takes System.Func<int,int,IEnumerator<string>> as argument so the compiler does not know ...

what is a good Pattern for using AsyncSockets in .net35 when inititiating several client connections

I'm re-building an IM gateway and hope to take advantage of the new performance features in AsyncSockets for .net35. My existing implementation simply creates packets and forwards IM requests from users to the various IM networks as required, handling request/ response streams for each connected users session(socket). i presently have...

Using google maps api in .net 3.5 MVC app

I have an MVC app which is pretty simple so far but I want to add a driving directions page to the clients location. I see plenty of examples using the traditional code behind model but none with MVC. The app uses master pages and content pages. I'm pretty new to MVC so bear with me. Any exaples of doing this would be much appreciated. ...

Do I need stored prodedures with Linq2SQL ?

I just started using Linq to SQL, and it just occurred to me that I don't really need any sprocs in the database since i can do all the data access through Linq to SQL. Is there any reason to write sprocs with Linq to SQL? Thank you. ...

Do i need one SocketAsyncEventArgs for each client connection made?

Please do i need a new SocketAsyncEventArgs for each client connection i make. I'm making several client connections in a loop, filling in the UserToken for each clients state from a database. Is there a way to reuse the SocketAsyncEventArgs and still maintain separate UserToken state for each connection. Thanks. ...

.Net 3.5 Chart Controls Exception

I am using the new free .net chart controls and they appear to work fine when I run the project up in visual studio, but when hitting the same via IIS I get and exception: [HttpException (0x80004005): No http handler was found for request type 'GET'] System.Web.HttpApplication.MapIntegratedHttpHandler(HttpContext context, String requ...

Recommended Prism v2 Silverlight/WPF Project Structure

I'm currently tasked with teaching all the developers, in the company I work in, about Silverlight (v2). The only problem is that I don't have any real Silverlight experience myself. Of course I've studied all the technical details about stuff like databinding, layout etc. so I can help my colleagues. But one thing that is hard to find a...