.net

Oracle .NET error - Wrong number or type of arguments

Now I know this has been asked before. But I've made doubly sure that all parameters are correct and there are no typos. I still get the error. Could somebody please guide me here? I am nearing my wit's end! CREATE OR REPLACE PROCEDURE VWT.WUA_DELETE_FP_REQUEST (i_pLDAPUserName IN varchar2, i_pIReasonCode IN number, i_p...

How to get all open channels in WCF

My application is leaking channels.Apperently some channels are not being closed correctly but i can't find where. At some point my application hangs because there is no channel left to open. Is there some method to get all open channels in the servicemodel so i c an backtrace the problem? ...

How to copy one Stream to a byte array with the smallest C# code?

Until now I am counting 12 LoCs. Could you make it smaller? using (Stream fileStream = File.OpenRead(fileName)) { using (BinaryReader binaryReader = new BinaryReader(fileStream)) { using (MemoryStream memoryStream = new MemoryStream()) { byte[] buffer = new byte[256]; int count; ...

Hang On Serial.Close(), Possible threading Issue?

The software im currently working on sometimes hangs when I close the serial port. Its intermittent and works fine 90% of the time but I clearly have an issue. When I ctl+Alt+Break it shows that its waiting on serial.Close(). I have lots a data coming in and out on the serial port which is being invoked to a number of forms so is this a...

Is it possible to write a generic function in .NET that only accepts numerical types?

Suppose I want to write a function like the following (as usual, a trivial example for illustrative purposes): Public Function calcSqSum(Of T)(ByVal list As IEnumerable(Of T)) As T Dim sumSq As T For Each item As T In list sumSq += (item * item) Next Return sumSq End Function As you can probably guess, this f...

Has anyone encountered: "Could not load file or assembly 'aspnet_compiler... Failed to grant permission to execute"?

I am encountering a strange build issue in .NET 3.5. The compiler is crashing when it attempts to build a Web Deployment Project. C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(531,9): error MSB6006: "aspnet_compiler.exe" exited with code -532459699. Which leads to: Could not load file or ...

Managed Threading General Recommendation #3

What does this from General Recommandation #3 mean? Don't control the execution of worker threads from your main program (using events, for example). Instead, design your program so that worker threads are responsible for waiting until work is available, executing it, and notifying other parts of your program when finis...

Code sign .NET assemblies or just the setup?

My company finally bought a code-signing certificate. I have a WinForms application (1 exe and several dlls), all assemblies are already signed with a strong name. The entire application is then packaged into a msi installer. Then I use NSIS to pack the msi, the bootstrapper and the prerequisites (Framework, SQL CE...) into a single set...

The proper way to do this - binding to properties

Hi all, I have 2 controls that both bind to the same dependency property "Weather". In the first control you put the current weather, the other one displays a forecast. In my XAML of the first control I bind a TextBox that contains the "Humidity" as follows. <TextBox Text="{Binding Weather.Humidity}" /> Whenever the Humidity changes...

How do I suppress a thread.abort() error C# ?

I am showing a splash screen on a background thread while my program loads. Once it loads I am aborting the Thread as it's only purpose was to show a Now Loading splash form. My problem is that when aborting a Thread it throws a ThreadAbortException that the user can just click Continue on. How do I deal with this? I was trying to ...

.Net Compact Framework & WinCE Question

Hello, I have never had any experience working with the compact framework or WinCE, however, I have a fair bit of experience developing in C#. How different is it developing for these platforms as opposed to just normal console or winforms applications in C#? Easy to pickup or are there lots of differences? Regards ...

Notify when all Rows are Loaded in a Silverlight DataGrid

I need to do some post-processing on a silverlight datagrid once all the rows are. I don't see any events that fire once that's done; what am I missing? Code samples or links are greatly appreciated. ...

Code editor plugin for MS outlook 2003?

I constantly find myself sending .NET code snippets to other developers using MS outlook email. Is there a code editor plugin I can use that can help in formatting and copy/paste (something like SO editor? ...

Making Infragistics Winforms UltraMaskedEditor Behavior Less Weird

I decided to replace my UltraTextEditors with UltraMaskedEditors to make things a little nicer for my users. (In a WinForms App) But the (default) behavior of the UltraMaskedEditor is quite different from what I've come to expect as standard textbox behavior. 1) The first field on the form (the one that gets focus on load) now shows u...

Screen scraping over SSL with .NET

What solutions exist for screen scraping a site over SSL for use with .NET? My use case is that I need to login to a partner website (https), navigate through a dynamic hierarchy, and download a zipped file of reports. I certainly could use other screen scrapers if there are no good viable options in .NET, either though the framework o...

Adding an ActiveX dll to a .Net project as reference works on one dev's machine, but not on another one?

Good afternoon, we're having a semi-weird problem here with a legacy activex dll that needs to be used in a .net project and strangely it works perfectly fine (adding it as a reference and all its functionality) on one developer's machine, but on no other ones, the build-server complains about a faulty reference etc etc. Whenever e.g. ...

"Could not load file or assembly or one of its dependencies. Access is denied."

I'm trying to debug the following exception:- System.IO.FileLoadException: Could not load file or assembly 'My.Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=........' or one of its dependencies. Access is denied. The code is impersonated in a COM service, but the assembly is present in the application directory...

WPF On Start detect if process is started and bring application to front

Hello, I have a pretty simple problem. When program has been started and user tries to start another instance. That new instance needs to bring old instance to front and quit. The solution seams pretty simple, I could take the code from http://www.codeproject.com/KB/cs/oneprocessonly.aspx and be done with it. Fortunately/Unfortunatel...

Security Concerns When Working With New Technologies

Do you find that when you work with a new technology that you're never quite sure what security gaps your leaving in your code? I've been working with ASP.Net Web Forms for about 5 years now and am fairly confident my code is at least secure enough to stop most known attacks. Looking back a lot of my early code I have unknowingly left ...

How do I tell whether a Type implements IList<>?

I want to write a method that uses Reflection to tell whether a given Type implements IList<T>. For example: IsGenericList(typeof(int)) // should return false IsGenericList(typeof(ArrayList)) // should return false IsGenericList(typeof(IList<int>)) // should return true IsGenericList(...