.net-3.5

Is there a more efficient method to find dupes in Sql server

偶尔善良 提交于 2020-01-06 04:28:28
问题 I have this question for which I provided a solution. However, I don't feel that is as efficient as it could be: using (DataContext context = new DataContext(SqlConnection) { var custInfo = context.GetTable<tbl_CustomerInfo>(); string compID = ImportCust.Rows[0]["CompanyID"].ToString(); var imports = from cust in ImportCust.AsEnumerable() select cust.Field<int>("CustomerID"); var dupes = from import in imports join cust in custInfo on import equals cust.CustomerID where cust.CompanyID==

Is there a more efficient method to find dupes in Sql server

别说谁变了你拦得住时间么 提交于 2020-01-06 04:28:10
问题 I have this question for which I provided a solution. However, I don't feel that is as efficient as it could be: using (DataContext context = new DataContext(SqlConnection) { var custInfo = context.GetTable<tbl_CustomerInfo>(); string compID = ImportCust.Rows[0]["CompanyID"].ToString(); var imports = from cust in ImportCust.AsEnumerable() select cust.Field<int>("CustomerID"); var dupes = from import in imports join cust in custInfo on import equals cust.CustomerID where cust.CompanyID==

I am trying to save images in wpf application, but after saving some pink color is coming on that images. Is there any solution for that?

不问归期 提交于 2020-01-06 03:07:34
问题 I am developing a WPF application. In which I am trying to save images. After saving the image, the color balance of the image turns to light reddish. How can we retain the original color of image after saving also. Is there any solution for that. 回答1: I suspect you are saving images with transparency into a BITMAP format. Bitmaps do not support transparency as such, but usually use a colour replacement technology to give the illusion of transparency. The default colour for this is magenta I

Team City build fails after upgrade to VS 2010

£可爱£侵袭症+ 提交于 2020-01-06 02:53:06
问题 I have a project that currently compiles happily on my dev machine using VS 2010 (presumably using MSBUILD v4.0), but it fails under MSBUILD v3.5 in Team City (running on a VM based on Win 2003 server w/ .NET 2, 3.5 and 4 installed). This project is newly upgraded to 2010, and is now failing on the CI build. I've Googled this and tried everything obvious (plus a few things that didn't make sense) and nothing affects the outcome. The project fails with a sequence of errors like this: error

In WCF is it possible to pass a delegate to the remote object?

纵饮孤独 提交于 2020-01-06 02:44:07
问题 Is it possible to pass a delegate to a WCF remote object from the client and have the remote object execute the delegate? I would guess not since a delgate is a function pointer for the client process. My goal is to have an interface structure that I can "subscribe" to events from a client to the interface. I would pass a delgate from the client to the interface and I want the interface to be able to execute the event. The idea is to have the ability for the interface to be loaded either the

How to get XML namespace?

家住魔仙堡 提交于 2020-01-06 02:20:28
问题 I tried using this code: [C#] var textReader = new XmlTextReader(path); if (textReader.NamespaceURI == "http://www.portalfiscal.inf.br/nfe") { //... } My XML: <?xml version="1.0" encoding="utf-8"?> <NFe xmlns="http://www.portalfiscal.inf.br/nfe"> <infNFe version="2.00" Id="NFe31130317194994450127550012302143751002144567"> <ide> //continue... But my code always returns "" ... Is there a easy way to get XML namespace? 回答1: Your code will return the namespaceUri of the current node. Try to

C# Unity 3D NAudio throws NullReferenceException while checking for default audio endpoint

别等时光非礼了梦想. 提交于 2020-01-05 13:14:02
问题 I've just installed Unity 3D because I wanted to make a simple game. There is one problem with the NAudio library though. This is my code: var enumerator = new MMDeviceEnumerator(); if (enumerator.HasDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia)) //<--- crashes here { //... } This is literally all Unity says when trying to launch the game: NullReferenceException: Object reference not set to an instance of an object NAudio.CoreAudioApi.MMDeviceEnumerator.HasDefaultAudioEndpoint

C# Unity 3D NAudio throws NullReferenceException while checking for default audio endpoint

白昼怎懂夜的黑 提交于 2020-01-05 13:13:48
问题 I've just installed Unity 3D because I wanted to make a simple game. There is one problem with the NAudio library though. This is my code: var enumerator = new MMDeviceEnumerator(); if (enumerator.HasDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia)) //<--- crashes here { //... } This is literally all Unity says when trying to launch the game: NullReferenceException: Object reference not set to an instance of an object NAudio.CoreAudioApi.MMDeviceEnumerator.HasDefaultAudioEndpoint

NHibernate Mapping Attributes + Dirty Checking

橙三吉。 提交于 2020-01-05 07:55:08
问题 I have problems with NHibernate updating some of my entities when this is not supposed to happen (dirty checking). As I use NHibernate.Mapping.Attributes to map my classes, I have found that there is a parameter "Check" to the element "Class" of NHMA. I would like to know if I can turn off dirty checking by setting this parameter to false or something (the required type for this parameter is string, so it may not be that). Any help would be appreciated ! 回答1: Firstly, this is not something

Any reason why NGEN should hang and never complete for a particular assembly?

穿精又带淫゛_ 提交于 2020-01-04 14:12:49
问题 I have a class library project for .NET 3.5 built with Visual Studio 2008. If I try to NGEN the core assembly in this solution file, NGEN never completes, or at least not in the time I've bothered to let it run (like overnight). Has anyone else experienced this? And if so, did you solve it? And if you did, how? What steps did you take? If this is a bug in NGEN, how do I post this to Microsoft? I have a connect account, but where do I post a bug-report for this particular product, instead of a