.net

How can I return data via C# AJAX to a javascript variable?

I am using jQuizMe, the jQuery plugin for quizzes, and I want to get the quiz questions out of a database. So I thought that I could use an ajax call to fetch the questions and process them to mimic a JSON-like array. I would then like to take that AJAX responseData and store it (as a JSON-like array) in a javascript variable. Here is t...

how to format a number to S9(5)V99 ascii in .net

I've been searching for s9(5)v99 but got different information and not really clear. Could someone shows how or the formula to convert. thanks ...

UrlEncode/System.Web not available in console application?

I need UrlEncode in my application because i am submitting a form to my server. My app is a quick console utility targeting to .NET 3.5. The page says i need System.Web assembly, yet when i try to add the reference it isnt there. My WebServer application has it which is also targeted to 3.5 but this console app cant reference it. Why no...

C#.NET: Convert Icon to byte[] and back again

How does one convert between System.Drawing.Icon type and byte[]? I'm looking for something simple that can (hopefully) work in .NET2. ...

is .net faster than java

I heard a lot of people saying that java is slow comparing .net, like they had servers with application on java with jboss hibernate and other stuff and it was really slow, but when they moved to .net all the performance issues disappeared. Is java really much slower ? isthere any benchmarks made ? ...

MathML equation editor widget for ASP.NET site

I am looking for a widget that I can plug in to my ASP.NET site that will allow users to create math formulas with their associated MathML. Ideally this would be similar to an HTML editor like TinyMCE. There have been solutions in the past (see http://stackoverflow.com/questions/698272/mathml-latex-or-similar-for-web-based-wysiwyg-edito...

IPC mono <-> .NET?

I have two processes running on the same windows machine. One is using mono, the other is using MS .NET. What is the best solution for inter process communication? ...

.Net UpdatePanel and javascript disabled

This may sound, or actually be, a stupid question but I need to find the best way to proceed with a project I am on. I have a multipage webform, using the multiview control. That multiview is in an updatepanel control, and everything works great so far. My question is about users with javascript disabled. What I have noticed is that in...

Binary (De)Serialization of a stream of objects to 1 file

I am faced with the following problem. I need to (de)serialize (binary) a stream of objects to a single file on disk. Serialization part is not an issue, just open a stream in append mode and use .Net's BinaryFormatter Serialize method and you are done. The problem with this approach is that I can't just give this stream to BinaryFormatt...

How to test the accelerometer for Windows Phone 7?

I'm wondering what is the best way to test the accelerometer? There doesn't seem to be any simulation for movement on the emulator, and mocking seems like it would be difficult. Should I just do a best guess and wait until the real devices come out or is there another approach to consider? ...

Building An App With Plug-in Support

I'm starting a new project which would greatly benefit from program add-ons. The program in its most basic form reads data from a serial port and parses it into database records. Examples of add-ons that could be written would be an auto-archive add-on, an add-on to filter records, etc. I'm writing both the program and the add-ons, but s...

Good advices to use EF in a multithread program ?

Have you got some good advices to use EF in a multithread program ? I have 2 layers : a EF layer to read/write into my database a multithread service which uses my entities (read/write) and makes some computations (I use Task Parallel Library in the framework) How can I synchronize my object contexts in each thread ? Do you know a g...

Reading zip files without full download

Is it possible to read the contents of a .ZIP file without fully downloading it? I'm building a crawler and I'd rather not have to download every zip file just to index their contents. Thanks; ...

How can I fire an event so my other form reacts to it?

I have this form called MainForm.cs. When I click Enter The Progam button I display another form using the .ShowDialog() method. In this new form called LoginBox.cs, I check if the entered credentials are valid and if they are I want my MainForm.cs to react with either a positive responde (the actual software form opens) or negative res...

How to get clean XML rest result from WCF REST Startkit?

I am using WCF REST Start Kit for Visual Studio 2008 or .Net 3.5. The example service will be able to get clean xml result like this: <SampleItem> <Value>SampleValue</Value> </SampleItem> The SampleItem is a simple class with Value property in Service.scv.cs. Then I tried to use a customized class like [global::System.Serializable(...

.NET MVC Masking Password textboxes

I was under the impression that using an annotation like this: <Required()> <DisplayName("Choose a Password:")> <ValidatePasswordLength()> <DataType(DataType.Password)> Public Property Password As String Would create a masked field when used in the view: <%: Html.TextBoxFor(Function(model) model.Password) %> <%: Html.ValidationMessag...

Should I have a thread that sleeps then calls a method?

Hi I wondering would this work. I have a simple C# cmd line application. It sends out emails at a set time(through windows scheduler). I am wondering if the smtp would say fail would this be a good idea? In the smtpException I put thread that sleeps for say 15mins. When it wakes up it just calls that method again. This time hopefully ...

Ordering Navigation Properties - Entity Framework

Is there a way built into the entity framework or commonly used pattern for ordering lazy loaded navigation properties to ensure no matter how they are accessed they are always in the correct order. I would like to avoid having to write properties or methods on partial classes if possible. Thanks for any help. ...

What are best practices on managing database connections in .NET?

Regarding best practice for managing database connections in a .NET application -- I know that, in general, it's bad to pass around a connection object. However, I have some specific curiosities: 1. I have two instances of business objects, of different classes, in a parent-child relationship (the child is private.) Whic...

Help about ActionScript socket communication with .Net

I'm using ActionScript to connect to a C# socket server. In the client (ActionScript), I use the following to send data: var socket:Socket = new Socket("localhost", 8080); socket.writeUTF("hello"); socket.flush(); In the server (C# 4.0), I use this: server = new TcpListener(IPAddress.Any, 8080); server.Start(); TcpClient client = ser...