.net

Deploying .NET applications to Amazon EC2 - what AMI image to use?

What AMI images do you use when deploying or testing .NET applications at Amazon EC2? Is this image based on Windows or Linux? Is it an image from AMI repository or something that you've built (if so, then is it public)? What version of .NET does it support (applies for Linux)? What other important features does it include? So far I'...

Why can't I do boolean logic on bytes?

In C# (3.5) I try the following: byte byte1 = 0x00; byte byte2 = 0x00; byte byte3 = byte1 & byte2; and I get Error 132: "Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?)". The same happens with | and ^. What am I doing wrong? Why is it asking me about ints? Why can't I do bool...

How does the MethodImplAttribute work in .NET?

I was investigating some framework code (the System.AppDomain.GetDynamicDir method) and this was all the assembler showed: [MethodImpl(MethodImplOptions.InternalCall)] private extern string GetDynamicDir(); What happens when this method is called? I don't mean this specific method, but methods with this attribute in general. ...

Regex to replace hyphen in the middle of a word

Hi, I need a regex to replace hyphens in the middle of any word but not to touch leading or trailing ones or standalone ones. This is for use in .NET within Regex.Replace() I've tried the following \w[-]\w but that also captures the character either side of the hyphen. As an example, what I need is for the following string -test t...

Ignore NAnt warning

Hi all, I'm setting up a build server using NAnt (and CruiseControl.NET) and I'm currently writing the build file for all the assemblies (both in VB.NET/C#) in the application. Unfortunately whem compiles most of the projects, NAnt signals several warnings which stop the building process. Since I know these warnings are almost unrealisti...

Installing shared assemblies into the GAC for development and build

I've read a few posts around here about the GAC and why you should never deploy applications by installing shared assemblies into the GAC. This i can see sense in as it should make updating applications on client machines easier. However, there are two areas where i could see the GAC being useful is for during development and on a buil...

simple ON/OFF Switch component controlled from code

Hi, i need to make simple switch component that can be triggered from c# window application like .net or VB... so.. By that component i can switch on/0ff external device(light,fan) using button trigger event or in specified time interval. i need, what all the component needed to make ...and brief explanation about process of...

Price Tracking App: Best Practice

I am working on a price tracking application that gathers data from different online stores and remap them to our own product database. We are already gathering prices together with the date they are retrieved. Our first presentation of this data would be retrieving average price and also prices in a form of line chart between price and...

System.AddIn in WCF

Hello, I have a question about use AddIn framework, provided by .NET Framework (currently use 3.5 SP1) implemented in System.AddIn namespace. I build a prototype with simple AddIn. This AddIn is instantiated in business logic of WCF Service. Implementation of business logic (only necessary code is shown): internal class BusinessLayer...

How to do multi user event driven screen updates?

I work on a Delphi program that uses a firebird database to store it’s data. It uses a home grown o.r.m. system. When two users look at the same data, for example in a data grid, and one changes something the other screen gets updated immediately. The way this works is that the objects in the one program store them self’s in the databas...

C# Advanced query statement String Processing

I'm looking for either a best practise or library for processing string into an object tree.. here is the example: "[age] = '37' And [gender] Is Not Null And [optindate] > '2003/01/01' And [idnumber] Is Null And ([saresident] = '52' Or [citizenship] Like 'abc%')" I should be able to objectize this into a tree something like this: {at...

using FUSLOGVW.EXE on a machine with no Visual Studio installed

I'm currently having some assembly binding problems on our development server. I want to investigate the problem a bit further with Fusion Log Viewer. Since there is no Visual Studio installed on the machine, I copied FUSLOGVW.EXE to a local folder and started it there. Is this supposed to work or does it need something else? I don't ge...

Sizing customized button to size of content

Hi, I've created the following very simple button style: <ControlTemplate x:Key="SimpleButton" TargetType="{x:Type ButtonBase}"> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" /> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Propert...

Interactive chart with timeline for WinForms .NET

Hi, I'm looking for WinForms .NET interactive chart control that will support timeline. By interactive I mean - something that will allow user to grab a top of a bar and change the value just by dragging it up and down. In some way the bar will behave like a horizontal slider By timeline I mean something that will allow user to scro...

DataGridView Selected Row Move UP and DOWN

How can I allow selected rows in a DataGridView (DGV) to be moved up or down. I have done this before with a ListView. Unfortunetly, for me, replacing the DGV is not an option (curses). By the way, the DGV datasource is a Generic Collection. The DGV has two buttons on the side, yes, UP & Down. Can anyone help point me in the right di...

How do ADO.NET DataTable Constraints affect performance?

Do constraints on a DataTable (e.g. PrimaryKey & UniqueContraint) make Selects more efficient in the same way that they would in SQL Server? Or is their only purpose to enforce rules on the data? myDT.Constraints.Add("PK", myDT.Columns["UniqueID"], true); //add a primary key myDT.Constrinats.Add(new UniqueConstraint(new DataColumn[] { /...

How to Add image in pdf using C# and iTextSharp?

I need your help adding an image to a PDF I'm using: string imgPath2 = localPath + "\\TempChartImages\\" + LegendPath; img2.Save(imgPath2); ith.WriteImage(imgPath2, 80); But this code give me error : "Use of unassigned local varible img2" How can I solve this error? ...

Asynchronous method appears to not be fully executing

I have a process where an incoming user request to our system is being handled. I also want to add some metadata about the request to a database table without impacting the responsiveness of the main process. To achieve this I added a call to an asynchronous method like this: public static ReturnObject ResponsiveMethod(string ip, stri...

WM6 .Net Form Effects C#

Hi All, I would like to know if it's possible to create nice form effects on the compact framework. My plan is that when a user selects an image on the main form this is opened in a new form, this currently works. What I now want to do is make the form that contains the fullsize picture to load off the edge (left or right) of the scre...

Settings File VS 2008 escapes c# carraige return

Hi, I am trying to persist the C# carraige return (\r\n) directive in a app settings file. The designer however is escaping the sequence to (\r\n) , a behaviour I don't want. I have manually modified the default value attritube in the settings.designer file ,but this only works for the life time of the application and then reverts to t...