.net

How to extend the timeout of a SQL query

This is not a connection timeout as a connection to the database is made fine. The problem is that the stored procedure that I'm calling takes longer than, say, 30 seconds and causes a timeout. The code of the function looks something like this: SqlDatabase db = new SqlDatabase(connectionManager.SqlConnection.ConnectionString); return...

Need some direction regarding windows service

Hi all, I need to do the following and i was wondering if i could get some of your input. Every night there is a file created at a certain location (on a ftp server). What i need to do is download this file and import it into a remote sql server via web services. I also need to have the ability to re-run the import process (download fil...

Will implementing IXMLSerializable create a serializer DLL file in my Temp directory?

Normally, when using the XMLSerializer to automagically serialize an ISerializable object, a .dll file is generated on C:\WINDOWS\Temp. If I implement IXMLSerializable instead, where I'm telling it how to serialize / deserialize, will it also generate this DLL? I have a very simple class to serialize, and I'm trying to avoid this automa...

How do I get a client's address from a WCF Service Application?

How can I get a client's address from a WCF Service Application? Also, is there an event raised when a client connects, possibly with address information? ...

Free plotting control for WinForms?

Hey! I want to display dots and functions in my dotnet app. Can you recommend a good free plotting control for WinForms? ...

How do I load an assembly that references a Win32 DLL?

I am developing a .NET application that uses reflection to load plugins. My plugins are C# class libraries. The trouble is that some of my plugins reference conventional Win32 DLLs, and C# is blindly attempting to load the dependencies as if they were .NET DLLs. Here is how I load a plugin: string fileName = "plugin.dll"; Assembly.Lo...

How create High Performance .NET classes using reflection?

Ok, so we all know Reflecttion is many time less performant than "newing" a class instance, and in many cases this is just fine depending on the application requirements. QUESTION: How can we create high performance .NET classes using a late binding (Reflection) strategy. I have an existing requirement that demands class instances be ...

Letting the client pull data

I'm writing a server in C# which creates a (long, possibly even infinite) IEnumerable<Result> in response to a client request, and then streams those results back to the client. Can I set it up so that, if the client is reading slowly (or possibly not at all for a couple of seconds at a time), the server won't need a thread stalled wait...

Bug in Visual Studio, or just a bad idea?

I made a custom control that is basically a multiline TextBox that allows input, and some other controls on the side that report some information. Now, I wanted to allow the user of my control to change the font in the TextBox, and thought something along the lines of: "Well, the user shouldn't be able to change the font of other control...

.Net SqlDataSource tag SelectCommand

Hi, My question is in regard to the SelectComman in the <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:conStr %>" SelectCommand="SELECT * " + "FROM myTable"> </asp:SqlDataSource> Obviously I have given an example but why won...

Can I get a path for a IsolatedStorage file and read it from external applications?

I want to write a file where an external application can read it, but I want also some of the IsolatedStorage advantages, basically insurance against unexpected exceptions. Can I have it? ...

Custom node names with XML serialization (.NET)

I have the following code: public class Foo {} static class Program { [XmlElement("foo")] // Ignored :( static public List<Foo> MyFoos { get; private set; } public static void Main() { MyFoos.Add(new Foo()); MyFoos.Add(new Foo()); XmlSerializer configSerializer = new XmlSerializer(type...

Learn just in time Or Learn just in case

This is not a question but more of a discussion. A while ago I ran into a blog post which talked about learning just in time or just in case. It was about three years ago when I just started learning about OO. I have been programming since 1995 in procedural world. Over the last few years fearing my skills are facing Obsolescence, I st...

.NET Language Pack

hi, there exists (for me) a problem with MessageBox show. my app is multi-lingual (english/german). i am testing on a windows which language is in english. setting the app to german language works fine but showing a MessageBox creates a mixture of the languages. Message is in german(via Resource files) and language of the buttons in ...

ActiveX for Browser. Which one should be choose VB6 or .NET?

Hi, I've to create an activeX control that need to run without any prerequisit (like .net). When user come by using IE, s/he just click and start using. No .net and anything else need to be installed. Actually, this query is about a print activeX control that just send a print directly without popup any window. I've created a .NET Comp...

error when installing .net 3.5 framework over windows server 2008

Hello all, I am trying to install .net framework over windows server (r) 2008 build 6001 (if it helps?). I am able to install .net 3.5 but when trying to install service pack 1 (from the following link) I get the following error. Microsoft .NET Framework 3.5 SP1 has encountered a problem during setup. Setup did not complete correctl...

How to detect which assemblies require the Partially Trusted Callers Attribute?

I have downloaded a web project from CodePlex and am getting the following error in Application_Start: System.Security.SecurityException: That assembly does not allow partially trusted callers. This project references several other assemblies from other open source projects. My theory is that one of these do not have the AllowP...

What is the easiest way to programmatically combine multiple PDF documents into one PDF document?

What is the easiest and quickest way to combine multiple pdf docs into a single pdf document, programmatically in C#? I am not looking for a random list of .net PDF libraries (there are loads on SO already), rather a specific library (and function) which will do what I need quickly and easily... Thanks! ...

How to disable keyboard and mouse events in a part of the visual tree without using IsEnabled?

I've the requirement to build pseudo-modal dialogs in WPF. That is, for some specific (technical) reasons the software is not allowed to spawn modal dialogs. Instead, the user should interact with "embedded" modal dialogs when necessary. I found a solution that works pretty well with MVVM and takes care of the Dispatcher and the synchro...

Styling ListBoxItem's of nested ListBoxes [WPF]

Hello, I have a ListBox with ListBoxItem's that contains a nested ListBox. Now I want the top-level ListBox's items to not have a blue background then they are selected (see pic). I tried to use the XAML below with a style to change the background color to transparent as descibed in this blog post. This works, but it also changes t...