.net

What causes TcpListener Socket Error 10013?

I get error 10013. msdn says its a permission denied error. An attempt was made to access a socket in a way forbidden by its access permissions My app ran fine. I then made a code change and restarted it. I got that error. I suspected i have to reuse ports so i wrote this in and still had no luck server.Server.SetSocketOption(SocketO...

Forms on an ASP.NET page

Hi, I have a website that was designed by a third party and contains several form, the forms are not nested so the HTML is valid. Now I am trying to port this HTML into an ASP.NET page. The controls in some of the forms require AJAX extenders (some Textboxes with Autocomplete) and I end up having Forms in Forms. The browser does not com...

Response.Redirect - Application_EndRequest

Hi, I have a weird behavior in my app's prod environment. Prod env has 3 servers and in one of the servers, page redirection causes the Application_EndRequest event to be fired; other two works as expected. I want to avoid the EndRequest event to be fired on page redirect. I am using Response.Redirect(url). I tried using Response.Redire...

Find index of a key? Dictionary .NET

I need to do currentKey+1. So i would like to find the index of the key value and get the next key (or first if at end). How do i find the current index of the key? I am using a Dictionary<int, classname> and i looked for .Find or IndexOf with Linq to no avail. ...

wpf - how do I apply same margins to all elements in a panel?

Is there a way of automatically tells all children items (e.g. labels, textboxes etc) to have a margin of 5, within a panel (e.g. dockpanel)? i.e. as opposed to having to set the margin for each element separately - also noting setting the margin on the panel itself is no good as then the panel has the margin not the elements. by the w...

Port confusion (breaks my .NET code)

Using netstat i found this in my list TCP 127.0.0.1:9832 My-PC:9832 ESTABLISHED My question is how is my local port outgoing AND CONNECTED to the same TCP port? This is breaking my code because i am listening to port 9832. I am getting a permission error. I need to lose firefox and reopen all my tabs before this...

Problems with Too many connections

I am using GM_xmlhttpRequest (greasemonkey xmlhttpRequest) to communicate with my app. Every half second it sends some json to update the status of a page. I am running 3 pages in FireFox. Using netstat -a i got these results. This is over 200 lines. Why am i using so many ports!?! How can i... not do this? and still communicate with my...

SQL Server 2008 Clone table with indexes in .Net

What would be the simplest way to create an exact structural replica for Table1 and all its indexes in the same database. Let's say Table1Dupl where all constraints/indexes from Table1 with suffix Dupl. I understand that I may do manual renaming "script table as " "create to" from Management Studio, but looking for fully programmatic w...

Query property of enum collection mapped as element

Hi, I have the class with enum property collection: public enum PropertyType { Apartment, Townhouse, AndSoOn } public class Company { private readonly ISet<PropertyType> desiredPropertyTypes; public virtual ISet<PropertyType> DesiredPropertyTypes { get { return desiredPropertyTypes; } } // other stuff... }...

WPF app + PHP, fastest way of communicate data

Hello may be you can help me. I'm wondering about the fastest way to send and receive information between a WPF app (client) and a PHP (web hosting server). Is tcp with sockets the way to go? or it'll have problems with the firewalls and IT related stuff? Do you recommend me to go for a rest php version? Webservices? I would like to...

How to call a server side method on losing focus from a textbox, asp.net mvc

I have two textboxes, one isfor 'program' and the other for 'description'. I have a predefined set of programs and it is associated descriptions in the database. Example : For program named 'Test' it has the description as 'Valid' in the DB Table For example, when enter a program name in the program textbox as 'Test', its associated ...

How do i handle clients better with TCPListener?

I had a problem with too many connections After a few test i deducted the problem is with MY server. The fact that the server listening port was on the left side should have told me. When running the same client code using a server on a different machine i dont get hundreds of ports opened. When my server on my local machine i get > 200...

How can i change team foundation to online?

My source control is TF. But i am offline how can i become online? ...

Deploy .NET (C#) exe application on desktops

I develop application in C# with MSVC 2010 Express, with Forms/WPF/etc. Application consist of some private assemblies (maybe DLLs) and .exe file. It uses .NET 4 features. How I deploy this application to other computers? Of course if they have .NET 4 I just can send zip of .exe with .dlls and it work. But if they don't have .NET at al...

FreeImage - Write zTXt tag to PNG

This is really causing me a headache. For some reason or another, I can add a specific tag to a PNG file, but it's not adding the way I'd like and I don't know how to get it to write the way I want Given the code; Dim FImage As FIBITMAP = FreeImage.CreateFromBitmap(Image) Dim FTag As New Metadata.MetadataTag(FREE_IMAGE_MDMODE...

Javascript parameter between <%%>

Hi I have a problem.I have a 'demo' controller with 'demo' action what get a parameter, and i want to give them in javascript. aspx: <script type="text/javascript"> function openDefault(miez) { var manager1 = $find("<%= RadWindowManager2.ClientID %>"); var str = "/demo/demo/" + miez; manager1.open(str3, "RadWindow...

how to use/migrate a dll (built by me) in silverlight ?

I have a class library built on .net 3.5, I wanted to use it in a silverlight project and it told me that I must build it against silverlight runtime, anybody knows how to do this ? can I migrate it, or should I create a new silverlight project and rewrite it or something ? ...

Fluent NHibernate JoinedSubClass is obsolete

Hello! I wonder about something. I'm sitting here with a solution there I have 1 superclass that has 2 subclasses and I'm currently mapping this using JoinedSubClass, but I get that this method is obsolete, and says that I should ClassMap and SubClassMap, but if I do this the AutoMapping does not work, and I don't want that. Is there an...

MEF: DirectoryPartCatalog

Hi, I'm trying to write a simple MEF demo to learn about it. I'm following this tutorial, but it seems to be outdated. The downloadable example works, but it uses an included assembly that is 2 versions older (2008.9.4.0) than the current one (4.0) that ships with Framwework 4. In particular, it uses DirectoryPartCatalog that I cannot ...

method overloading vs optional parameter in C# 4.0

which one is better? at a glance optional parameter seems better (less code, less XML documentation, etc), but why do most MSDN library classes use overloading instead of optional parameters? Is there any special thing you have to take note when you choose to use optional parameter (or overloading)? ...