.net

Generate custom RSS/Atom feed with SyndicationFeedFormatter made from XML

I have followed this article and implemented my service and I can open the web browser and see the test data being published. I would like to create a custom formatted response, as for my needs this will not be published to the internet and it's an isolated feed that other devices on the local network could read to get the data I'm publ...

.net - altering ListView runtime item values from a LinqDataSource

I need to programatically test and modify a ListView's column values at run time. The data is coming from a LinqDataSource ("LDS") and the LDS is declared to return an ordered subset of the target SQL table's columns. My inclination was to do this using the ListView's OnItemDataBound event, but at that time the ListViewDataItem is an an...

.NET Framework - Per Application Overhead

Does anybody have any concrete information on the overhead of using the .NET Framework 2.0/3.0/3.5? I am mostly interested in per-instance overhead and whether there is a "fixed cost" regardless of the number of instances, e.g. in a Terminal Services environment with 300 instances of a .NET Framework application running is there only 1 ...

How to drop controls onto a panel in a user control?

I have created a UserControl that has 3 panels. What I what to do is expose one of the panels to the Visual Studio designer so you can drop controls inside that panel. Currently I have the UserControl on a form but dragging say a text box over it will have the text box paint over the UserControl and not be a part of the user control. ...

Silverlight and problems with async call

Hi there, I have some code that works as follows: App.xaml calls a SetUp() method which populates a local collection using async calls and exposes the collection as a public property. That's all good. Now I make an instance of the first page in my Silverlight app like so private void Application_Startup(object sender, StartupEve...

.Net Windows Service not able to access a file

I have VB.net windows service and in one of the functions I am using a XML file which is in the same directory of the application. When I install the service though the service starts it is not finding the xml file. How do I include the XML file in the web service? If I copy the file to the same folder as the exe and app.config files, ...

Iterative Models and Stateless Environments

I have an iterative simulation model that does X per timestep. What's the best way to simulate that iterative model in a stateless environment like ASP.NET? Simulation data is in the 10 to 15 MB range. ...

Set collection preserving insertion order

I need a collection that behaves as Set and preserves order of element insertion. Is there one or I'll have to implement it myself? What would the best implementation be? ...

C# Array index out of bounds error

Full disclosure: This is for a homework assignment. This is driving me nuts. I'm writing a Discrete Cosine Transform function and have it basically complete, but I'm running into an IndexOutOfRange exception. Code is below: static int[][] DiscreteCosineTransform(int[][] pIn) { int[][] cosP = pIn; doubl...

Upload Multiple FTP Files

Requirement, upload 1500 jpg images every night, the below code opens and closes a connection many times, I'm wondering if there is a better way. ...this is a code snippet, so there are variables here that are defined elsewhere Dim picClsRequest = DirectCast(System.Net.WebRequest.Create(ftpImagePath), System.Net.FtpWebRequest) Dim picC...

Winforms localizable property problem

I changed the localizable property on a user control and the designer file was set to an unusable state. Now the variables components and statusMessageControl are never initialized. Is there a different solution I should be doing instead of moving the declaration and initialization of these variables to the main code file? The code went...

(.NET) ServicePoint.IPEndPointDelegate doesn't callback with proxy?

I need to bind the local ip address for an HttpWebRequest (machine has multiple ips). I create the delegate method, and this is called and the ip is bound for requests without a proxy, but once i add proxy details to the request, the callback never occurs How can i bind the outgoing ip address for HttpWebRequests that use a proxy? ...

productversion tab in csproj file changed when i build soultion

my solution is in vs 2003 and using many projects and when i have taken latest from source safe(perforce) and build the project it has given some library not finding error i.e. some porjects which are used in the solution are missing because those assemblies are not at those particular location. so in all csproj files where the hard cod...

looping for ... firstdayofprevmonth->last

Why my for works incorrect here ? int dayOfWeekNumber = (int)DateTime.Today.DayOfWeek - (int)System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; var previosWeekFirstDay = DateTime.Today.AddDays(-7 - dayOfWeekNumber); var yearsterday = DateTime.Today.AddDays(-1); ...

CheckBox Array in VB.net

Hello to all, I need to have plenty of checkBoxes & textBoxes in my vb.net form. So I really need CheckBox array to reduce coding of their events. But I am not able to create array of them like in VB-6 Also I need to make them at design time only. So in coding writing like dim chkBox as new CheckBox() And then setting location & t...

How can you block the image to appear on WebBrowser Control?

I have created a simple web browser using c# and I want to block the images to appear on WebBrowser control. Can you please show me a sample code for this? Thanks in advance. ...

Referencing a .NET DLL from a different VS.NET version?

Hi, I have a Visual Studio 2003 project. I need to refer a library DLL which is built in VS 2005 to this project. Is this possible? while directly referring i am getting an error in Visual Studio stating that "..this is not a valid library or com component...". But is there any workaround.I cannot convert my Visual Studio project fro...

Dispose the singleton object in .NET

Hello All I have two classes ClassA and ClassB both having a reference to a singleton object ClassHelper. My question is how should i dispose the singleton object once im done using both the ClassA and ClassB Edit: public ClassA { CHelper obj; public ClassA() { obj = obj.GetInstance("Initialise"); obj.CallFuncA(); } }...

convert ordinary web project to silverlight supported application

Hi, I have a dotnet web solution. I wish to include the silverlight technologies into it. Can you tell how do I proceed. I am new to silverlight...so might be this question a blunder :( ...

Can't resolve NameValueCollection with Autofac

I am using Autofac 2.1.12 to handle my dependency injection, and am having trouble with one specific issue. I can't seem to resolve a NameValueCollection dependency. Consider the following code snippet: class Foo { public Foo(NameValueCollection collection) { } } static class Run { public static void Main() { var b...