.net-3.5

ClickOnce deployment error on upgraded .NET application

I have a Windows forms application was developed in Visual Studio 2005 and deployed to an IIS server via ClickOnce. I've upgraded to VS2008 so I decided to upgrade and redeploy the application (in test). I ran the upgrade wizard, manually changed the project's target runtime to 3.5, removed all of the old publish files from the deploymen...

System.Data.OleDb.OleDbException: Too many fields defined

I'm working on building a .NET WinForms application to replace a series of forms in a Microsoft Access (insert collective groan here) database. In an effort to get the initial version finished, I am attempting to use the existing queries rather than digging into the data model and its obvious design problems. I'm calling the queries us...

Embbed photos to an Email

I am writing a Windows application which uses SMTP service to send email. I want to embed few dynamically created images to the Email content. How can I do this in .NET?. My format of email is HTML. I don't want to host my image to a photo hosting service. I don't want to send it as attachment. ...

What is the difference between new Action() and a lambda?

So when I write something like this Action action = new Action(()=>_myMessage = "hello"); Refactor Pro! Highlights this as a redundant delegate creation and allows me to to shorten it to Action action = () => _myMessage="hello"; And this usually works great. Usually, but not always. For example, Rhino Mocks has an extension metho...

Show Images in WPF ListBox

Hi All, I'm trying to display images stored in MSSql Db as varbinary, when execute my code it just hangs itself Code is as follows... XAML <Window x:Class="ImageList.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namesp...

Animated GIF problem in WPF

Hello all, <MediaElement LoadedBehavior="Play" Name="imgScan" Source="Images\Pre_Scan_RealImage.gif" Grid.Row="1" /> I have added above code in my WPF from which include animated GIF image, the problem is whenever form load I don't find any of the Image displayed on form, any suggestions ??? <Image Name="imgScan" Source="Images\Pre_...

Simple HttpWebRequest over SSL (https) gives 404 Not Found under C#

Hi, I want to make a POST to a php-written Web Service that sits on a secure connection. The following code is just a test console app I wrote after a few hours of trial and error. Essentially, I found out a few different methods to use HttpWebRequest, but all of them are the same thing. Testing my URI with 'http' on a web browser, sh...

XLS to PDF conversion inside .net

I've been looking extensively for a tool that takes an existing XLS file and converts it to PDF that then gets saved out to disk. The catch is I need to be able to call it from within my .net console application, which eliminates most tools I've looked at. Has anyone used something like this that they would recommend? My client is will...

DataTable.Select("Bla='Blablabla'").Count Returns 'Count' is not a member of 'System.Array' Exception

I'm trying to access the Count Property on the array of rows returned by the datatables select method, this is after converting the Web Project to 3.5 ...

How do I position an ellipse on a Silverlight Grid?

I am creating a silverlight application which will allow you to click at two places on the screen and will draw an ellipse whose major axis starts and ends at the click locations. The clickable area is a Silverlight Grid control. Currently: When you first click, I am: Dropping a marker at the click point. Creating an ellipse and paren...

How would I write this as a single LINQ query?

Using the following logic, what would the correct syntax be for a single LINQ query? If Branch is Service, I want its parent, otherwise I want Branch. Can you critique my attempt and let me know how I can improve it? int branchId = 21; var t = ctx.BranchInfos.Single(p => p.BranchID == branchId ); if (t.Type == BranchType.Service.T...

Eval strips time segment of a SQL DateTime field

Was going to call this "Eval won't give me the Time of Day," but thought that too cute. I'm kind of having the opposite problem from the suggested questions I see for my title, so here goes: Visual Studio 2008 Pro, SQL Express 2008, Vista. Web Project, where I'm opening records from an Event Table with JOINed info from a Facilities tab...

How can I check for a running process per user session?

I have a .NET application that I only allow to run a single process at a time of, however that app is used on Citrix boxes from time to time, and as such, can be run by multiple users on the same machine. I want to check and make sure that the application is only running once per user session, because right now if user A is running the ...

How to change the color of progressbar in C# .NET 3.5?

I'd like to do two things on my progress bar. Change the green colour to red. Remove the blocks and make it in one color. Any information about those two things I wonder how to accomplish will be greatfuly appreaciated! Thanks. ...

how to best design a wrapper for an access database using c# 3.0?

hi guys, i have only very limited exposure with .net 1.1 and a bit of 2.0, so i'm actually pretty excited and confused with the many changes that they have in .net 3.5. so i have this access database but we don't want the other programs from calling into this database directly. so i'm writing a wrapper exe which will contains functions w...

Is it possible to auto-generate my Linq2Sql DBML via a script?

I use Linq2Sql and am tired of recreating the dbml everytime the database changes. Is it possible to script the creation of my model given that I want ALL tables and ALL procs? Ideally it would be part of the build process or a custom tool. A simple "refresh from schema" button would be fine too, but from all I can tell, there is no s...

Issue when creating an installer using wix to install in a specific website(NOT in Default Web Site)

Hi, I am creating an .msi using wix to install in "Test Web Site". But it always installs in "Default web site". The .wxs looks like: <iis:WebVirtualDir Id="VirtualDir" Alias="TestService" Directory="Test_dir" WebSite="WebSiteId" > <iis:WebApplication Id="TestWebApp" Name="TestService" /> </iis:WebVirtu...

c# lamba expression - add delegate results to generic list

Question: I have just wrote my first code using c# lamba expressions. It works, but I am not sure if this is the best way to do it. Any recommendations on a better way to do the lambda expression? It seems odd to have numerous lines of code in the expression like I do below. Background: I have a generic list of delegates. Each delega...

Windows Service Development in .Net 3.5

Hi all, I am currently developing a Windows Service with a .Net 3.5 target. I am having a number of issues with this: Although I have a setup project in the solution it doesent install the service (platform is vista) even tho the installer completes successfully. I have to manually install the service using the InstallUtil.exe which ...

c# array function argument pass one dimension

Let say I got this function : void int Calculate(double[] array) {} And in my main I got this array: double[,] myArray = new double[3,3]; How can I call Calculate(...) ? I try (that's don't compile) : double[] mySingleArray = myArray[0]; What I want to avoid is unnecessary loop (for). I declare a regular array, but if a jagge...