.net

LINQ to SQL: how to retrieve auto generated integer id primary key

I suppose the question was asked before (it's so general) but I can't find the answer. How can I retrieve auto generated integer primary key value after I inserted a new row and called "SubmitChanges" ? I need to know the key exactly on the client-side 'cos I'm going to use this value further for calculations. When unique key is Gui...

short cut to view function list in VS2008 which is right under Document tabs

is there a short cut key to view function list in VS2008 which is right under Document tabs ...

C# Generic Type is boxed?

I executed the following code: using System; using System.Collections.Generic; namespace TestReleaseAndDebug { public class GClass<T1, T2> { public T1 Name { get; set; } public T2 Age { get; set; } public void Display() { Console.WriteLine("Name: " + Name); ...

Refresh ObjectContext or recreate it to reflect changes made to the database?

I have a web service that exposes operations to and from a database. I'm using Entity Framework 4 for the DAL. I'm wondering what would be the best way to handle operations to and from the database. Would it be best not to keep alive an instance of the ObjectContext and instead create one for each operation done to the database? This se...

Download files from net using threading or not.

I need to download a huge number of files from net based on a keyword. The steps i am following are Using Scraping figure out the links to files Using WebClient.DownloadData() download the byte[] Save the arr to a file. Is it a good idea to create one thread for downloading each file for better performance. Any suggestions. Thanks f...

Windows authentication in Java

Hi, I am developing a java application (running on a Linux server) that needs to connect to a .net WCF web service configured to use Windows authentication only. It seems to work fine when I run the app on my Windows desktop. Is there any way to make it work from the Linux server? ...

Is there a "Try" convention?

I sometimes see methods in the .net framework prefixed with "Try" e.g. int.TryParse(..). I assume this means that the method is the same as a int.parse, but wrapped in a try catch? Does this mean that if I write methods which have a try catch around them (e.g logging, which I never want to raise an exception), they should be prefixed w...

How to include deployment files with a TFS build

After my TFS build completes, I need to run a couple of .bat files to rename/copy files so that the package is ready for a particular environmeent. I've included these in one of my class library projects so they set to them "copy if newer", but idealy, I would like to include these in a Solution Items folder. However when I add them to ...

using RegEx to replace string

hi, i have this pattern i using to replace string: var html = "some test string"; var regex = new Regex(@"<(.|\n)+?>", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Multiline); var result = regex.Replace(html, ?); this pattern matches all html tags <anything here> and replace with ?. actually ? is " " or "" accordin...

WIX Custom Actions built for .Net Framework 4.0 does not work? Ways to resolve?

We were using WIX 3.5 (Build Number 1811) and built a custom action built using Visual Studio 2008 and with target framework as .Net 3.5. This used to work great, until we built the custom action using Visual Studio 2010 and with target framework as .Net 4.0. WIX is unable to invoke the custom action, the error that we get is this: S...

What practices are you now using after reading about DDD?

I've been doing some reading on Domain Driven Development but can't see how this would really change any development practices, besides maybe keeping our domain object names insync with elements in our requirement documents. For those really into DDD, how has this change your development pracitces? ...

Convert VB.NET code to C#

Hi, Is there a library that I can use to convert VB.Net code into C#? There is http://codeconverter.sharpdevelop.net/ but i don't want to use it from a web service. ...

.NET DateTimePicker

I’m currently trying to use this control to provide a means of selecting a date and time from a dialog box. However, I can’t seem to work out how to allow selection of a date AND time (format seems to allow short, long, custom and time). Please could someone point me to the relevant property for this? ...

Reference COM+ from .Net with varying GUID

Hi, We have a project that references COM+ components (written in VB6). The components are added to our .Net solution by 'Add reference'. This works well and even intellisense works. Now and then the interfaces (compatability) of the components are broken and our .Net code doesn't work anymore. The component was added with a specific ...

Exe version in MSI installer file name (VS 2010)

Hi, is it possible to make Visual Studio 2010 installer output file name, containing exe version, something like "setup[MajorExeVersion][MinorExeVersion].msi"? Thanks! ...

.NET File Management Control

I am currently working on a portal site for provisioning Intranet sites in a Windows Server 2008 based infrastructure, and I am in need of providing a file management control that will allow the users of the portal to upload their sites to the server and manage the files. I have looked at solutions like FileVistaControl (which would work...

TestDriven.NET Personal version vs Professional Version

Hi I'm having trouble finding online resources on the feature differences between the Personal version and Profession version TestDriven.NET. Below is the download link http://www.testdriven.net/download.aspx For example what features that Professional version offers but not in the Personal version? Can anybody points me to the corr...

Suppress exception popup window for .NET application launched from unattended code

Hi, I have a pre-built .NET Console application EXE that I am launching from separate C# code using the Process class. If the application throws an unhandled exception, a window pops up (the one that says " has encountered a problem and needs to close..." and has "Debug", "Send Error Report" and "Don't Send" buttons). If this happen...

SASL library for .net

I am searching for a sasl library for .net. So far I could only find: Sasl.Net but it looks dead and only implements plain and digest-md5. Can anyone suggest a good library? Preferably an open-source implementation. ...

Paint background only once.

I have a drawing graph on a panel. The drawing has 2 components: "background" Grid and "foreground" graph. The user can move the graph lines, but the background remains static (for a selected time interval). Re-drawing the background is a little expensive. Is there a way to keep the background "intact" and redraw the "foreground" graph ...