.net

.NET: Channel and sinks between unrelated appdomains

I am of the understanding that when a new appdomain is created, the framework creates channels and sinks implicitly. If it didn't, you couldn't create an object in one appdomain and make use of a proxy in the other. (This is an understanding; please correct me if I am wrong.) Additionally, if an object is marshaled for remoting purpos...

Rotating portfolio of several websites

I have taken up the banner of producing a portfolio for my web design/development group. This portfolio would be full screen on a nice flat panel TV and rotate through a list of our websites that we have built. That is really the only requirement - display our work on a big TV for people to oogle over when they enter our office. I have t...

.NET dll from PowerBuilder (10 or 11.5)

If I am looking to reference a .NET dll from PowerBuilder (10 or 11.5), which of the following is the best practice? 1) Register the dll as a COM Object, and use the COM Object via an OleObject 2) Upgrade to 11.5, and convert to PB.NET so that I can actually have blocks of C# in the PowerBuilder code 3) Another method What are some ...

Safe/Allowed filename cleaner for .NET

Is there any standardized / libraried / tested way in .NET to to take an arbitrary string and mangle it in such a way that it represents a valid file name? Rolling my own char-replace function is easy enough, but I'd like something a little more robust and resued. ...

FxCop: control assembly referenced by analyzed assembly not being loaded

FWIW: Windows 7 64bit, Compact Framework v3.5, FxCop v1.36 (running fxcopcmd.exe) I'm having problems getting FxCop 1.36 to run correctly. I'm analyzing a compact framework application with the globalization rules from http://www.dotneti18n.com/Downloads.aspx the .exe that i am analyzing has a reference to a 3rd party control suite: re...

C# multi method attached to event, how to handle return value?

This is the call: bool isValid = true; if (this.ExternalConstraint != null) { isValid &= this.ExternalConstraint(this, EventArgs.Empty); } if (isValid) { //... } The event look like: public delegate bool externalConstraint(object sender, EventArgs args); event externalConstraint ExternalConstraint; When debugging I n...

How can I verify that a TCP packet has received an ACK in C#?

After sending some tcp data with the blocking/non-blocking methods such as: Socket.Send() or Socket.SendAsync() How can I know that my data has received an ACK message? Can .NET know if TCP data has been successfully sent? ...

C# exposing to COM - interface inheritance

Say I have a class BaseClass that implements IBaseClass Then I have an interface IClass that inherits IBaseClass. Then I have a class named class that implements IClass. For example: [ComVisible(true), InterfaceType(ComInterfaceType.IsDual), Guid("XXXXXXX")] public interface IBaseClass { [PreserveSig] string GetA() } [ComVisible...

Specifying and displaying columns of a DataGrid in WPF declaratively using a binding?

Is there a way to specify DataGrid columns declaratively using a binding? (And to set the columns' properties using this binding?) Idealy, I would have a list of objects (e.g. rows) databound to the ItemsSource and one of their properties would be a dictionary (or a list of objects of a certain class or whatever) with a name and a value....

add asp.net control using javascript

I would like to add an ASP:label and ASP:textbox control to a page through Javascript. <asp:Label ID="lblone" runat="server"></asp:Label> if i want to write this syntax or want to add this label on page using innerHTML then want can be the way.... I want to add it on button click event... and the ID should be appended by 1 and the ne...

WCF - Client callback vs. polling for "keep list of subscribers"

I want to create a simple client-server example in WCF. I did some testing with callbacks, and it works fine so far. I played around a little bit with the following interface: [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IStringCallback))] public interface ISubscribeableService { [OperationContract]...

How do I set up a connection string for a MySQL database in a C# project without using dialog boxes?

NOTE: Apparently, the reason the MySQL connector installation doesn't show up automatically in the Dialog Boxes for adding a data source is because the Visual 2008 Express Edition doesn't allow "3rd party integration" within the Visual Studio IDE. So, this makes setting up the data source manually even more important because the integrat...

Excel file with multiple sheets from SSRS Reports

Hi, Let's say i have 3 byte arrays, each representin a .xls file. How can i combine them into a single xls file with 3 sheets. The SSRS reports are very rich and include charts sp oledb is not an option. Performance is not important so i could save them to disk if needed, as a last resort i could even use an excel macro (if i knew how ...

C#, XmlDocument, and special ISO Latin characters

I'm trying to load up xml into an XmlDocument, but it doesn't recognize the encoded '&eacute' and throws an error 'An error occurred while parsing Entity Name'. Now I can add a custom entity set in a DTD of my xml, so the XmlDocument loads properly. But what I'm hoping is that I can reference a url that has a common set of these ISO La...

SOA Architecture Real-World Samples with .NET

Hi, Any SOA Architecture (n-tier) Real-World Samples with .NET for getting started ? Thanks. ...

WPF - How to set DataContext on virtual branch of logical tree?

How do I set the DataContext of "myElement" to the same DataContext as the user control in XAML? I have been able to do it in code-behind via myElement.DataContext = this.DataContext in the UserControl constructor, but I'm trying to understand how to do the same thing in XAML. This is related to creating virtual branches to the logical ...

.NET String performance question

Is it better, from a performance standpoint, to use "Example1"? I'm assuming that "Example2" would create a new string on the heap in each iteration while "Example1" would not... Example1: StringBuilder letsCount = new StringBuilder("Let's count! "); string sep = ", "; for(int i=; i< 100; i++) { letsCount.Append(i + sep); } Exa...

How to create Large resumable download from a secured location .NET

I need to preface I'm not a .NET coder at all, but to get partial functionality, I modified a technet chunkedfilefetch.aspx script that uses chunked Data Reading and writing Streamed method of doing file transfer, to get me half-way. iStream = New System.IO.FileStream(path, System.IO.FileMode.Open, _ IO.FileAccess.Read, IO.FileShar...

WPF - Why isn't ValidationRule a DependencyObject?

Is there a technical reason why ValidationRule is not a DependencyObject? ...

restarting windowservice problem

Hi i made some changes in windowservice coding side(some class files related to that),,means i did coding to fetch version value from registry in that class files,,,,After ...