.net-3.5

WCF 3.5 and UDP

Is it possible to make udp binding in wcf 3.5 or it's only possible in .net 4.0 ? If it's possible in .net 3.5 could somebody give me an example please ? thanks ...

Using a NetworkStream to transfer a file

I am having trouble transferring a file to a client from a server program. A few problems I would like to address. First is that I make the byte array 6000 bytes big and its always that size. Is there a way to maintain the correct file size? Also with the way the code is now, the program hangs. It works when I take it out of the while lo...

Prevent MVC Action method from executing if a parameter is null

I've thought of a few ways of doing this but I want to get the community's view. I have a feeling that the answer is cringeworthily simple - I'm not afraid to look stupid (my kids took that fear away from me long ago!) I'm writing an XML REST web service using MVC2. All XML Types that consumers of the web service will receive and send...

Entity Framework 4.0

Hi, I am new to EF 4.0 . How to make sure EF 4.0 installed on machine? Thanks for help, Jaydeep ...

is there a better way to find rows with all column with values?

I need to find rows in resultsets that have every column without null. these resultsets got variable number of columns. currently, the only way that I can think of is creating a view on each resultset and filter this way: select field1, field2, field3, field4, ... from "huge query" where field1 is not null and field2 is no...

time portion from datetime value in LINQ

I have field which is of type DateTime. When inserting a record, I am also providing the time into the field. When reading that field with LINQ, it will return me the correct date but the time values has the default, 12:00:00 AM In the database, I have values with date and time for each record which is correct. The problem is that the...

The bizarre case of the file that both is and isn’t there.

In .Net 3.5, I have the following code. If File.Exists(sFilePath & IndexFileName & ".NX") Then Kill(sFilePath & IndexFileName & ".NX") End If At runtime, on one client's machine, I get the following exception, over and over, when this code executes Source: Microsoft.VisualBasic TargetSite: Microsoft.VisualBasic.FileSystem.Kill Mess...

SetWindowsHookEx failing in .NET 4.0 on 32-bit machine with "module not found"?

I have found similar questions on this page, but I can't seem to figure out how to interpret the answers or figure out if they are truly duplicates. Here are the possible duplicates I've found, with comments: SetWindowsHookEx returns 0 when compiling for the .NET 4.0 framework in 32bit machines It doesn't seem to return 0 on mine, bu...

How to share libraries without using the GAC?

I have a library that is meant to be used by many websites. The way I am doing it now is in the library's properties, I set the "Post-build event command line" to: copy "$(TargetPath)" "$(SolutionDir)\MyWebsite\bin\$(TargetFileName)" Every time I want a new website to use the shared library, I add a new line like this: copy "$(TargetPat...

GridSplitter with button for pinning like behavior

I'm looking to extend the GridSplitter in some way to add a button which when click expands or collapses the control to one of the specified sides of the splitter. I've found a solution that works for Silverlight 4 but I need this to work for standard WPF in .NET 3.5 which means that the GridSplitter doesn't implement the Visual State M...

Using LINQ to order a list using an existing array.

class Car{ int ID {get;set;} string Text {get;set;} } List<Car> allCars = new List<Car>(){ new Car{ ID = 1, Text = "one"}, new Car{ ID = 2, Text = "two"}, new Car{ ID = 3, Text = "three"}, new Car{ ID = 4, Text = "four"} }; int[] existingCarIds = new int[]{ 2, 4 }; I would like to have this list. CarWithID2 CarWithID4 CarWi...

Side By Side ClickOnce Installations

I would like to deploy a TEST version of my internal application to my testing group and I need it to install side by side with the current LIVE version. I changed everything in the Publish Options but it STILL overwrites my LIVE install. What else do I need to do? Do I have to change the Assembly Name on the Application Tab? Is tha...

Visual Studio Crashing when I am using a certain solution

Whenever I open a solution for Project A it works for a little while(time varies) then the window freezes and eventually crashes. However when I open Project B I can work on it all day and it works fine. Exception Information Code: 0xe053534f Flags: 0x00000000 Record: 0x0000000000000000 Address: 0x000000007c812afb Error Signature ...

How to populate a gridview with table data from sql

I want to populate a gridview with table data from SQL. I tried just returning my SqlDataReader object and using it as my datasource, but I am getting errors that the reader has been closed. I wanted to convert this to a DataSet and just return a dataset, but I couldn't find an easy way to convert the row data to a dataset. I've also ...

Get Absolute URL from Relative path (refactored method)

I am really surprised that there is no native .NET method to get an absolute url from a relative url. I know this has been discussed many times, but never have come across a satisfactory method that handles this well. Can you help fine tune the method below? I think all I need left is to auto choose the protocol instead of hard coding i...

How do I get DebuggerBrowsable RootHidden to work?

I read about the DebuggerBrowsable attribute yesterday, and it sounded great, however when I tried to get it to work in a test, It doesn't seem to make any difference. I am using VS 2008 version 9.0.30729 1 SP, .Net 3.5 SP1, MSTest framework [TestClass] public class TestingDebuggerBrowsable { [TestMethod] pub...

To-do list(view)s with time displayed?

In a C# (3.5) Winforms app I have a FlowLayoutPanel containing a number of listviews. Each listview represents a short to-do list sorted in a sequential order with assigned priorities. Occasionally a user has to create a new priority 1 to-do item. An issue arises when there are multiple priority 1 instances - how does the user know wh...

Problem Implementing WebInvoke Method="POST" for a REST Service on WCF

Hi all and thanks for your time in advance. I have a problem trying to get to work a REST method under WCF. The method is POST, and I'm not able to retrieve the values sent from the Request. This is how I declare the service according to an exemple from Microsoft about the WebInvokeAttribute Class: [OperationContract] [WebInvoke( ...

can connection string in SQL Server 2005 be taken from a file??

I have created a web enabled DB for a company as a part of my internship and it's up and ready. However the connection string of the server is already coded by me. But the IT guy said that he wanted me to read the connection string from a file containing various connection strings and choosing whichever it wanted to at that time. My que...

Best practices for dealing with LINQ statements that result in empty sequences and the like?

...I'm a little confused, or unsure about how to deal with errors that arise from LINQ statements. I just love being able to pull one or more items from a collection, based on some criteria... with a single line of code. That's pretty awesome. But where I'm torn is with the error handling, or the boundary condition checking. If I wan...