.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

RemotingException when drag and drop from one instance to a second instance of Windows Forms applica

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Windows Application

I have a Windows Forms sample app that we use to illustrate drag and drop functionality with our external application. The sample app contains two list boxes, a DragSource and a DropTarget. The DragSource is populated with data that can be dragged and dropped to the DropTarget, or to our external application. The sample app is written in Visual Studio 2008 using a Windows Forms Application that links to a legacy C++ library.

What works:

1. Dragging and dropping between the two listboxes in the same instance

2. Dragging and dropping between the sample app and our external application

What doesn't work and hope to get your feedback on:

1. Dragging and dropping between the sample app and another instance of the sample app fails to read data from the MemoryStream and indicates the following exception: "A first chance exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll"

2. Dragging from the DragSource indicates the following exceptions although the DropTarget and our external application are able to read the stream and display the information.

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Windows.Forms.dll; A first chance exception of

View Complete Post

More Related Resource Links

ASP.NET: Web Forms Let You Drag And Drop Your Way To Powerful Web Apps


Web Forms have the potential to change Web programming by introducing a new programming model built around server-side controls-a model in which controls render their own UIs by generating HTML to return to clients and firing events that are handled by server-side scripts. Since all the action takes place on the Web server, virtually any browser can run a Web Forms app. And thanks to Visual Studio .NET, building a Web Forms app is a lot like using Visual Basic: just drop a control onto a form then write an event handler. This article describes the Web Forms programming model, how it fits with ASP.NET, and introduces DataGrid, TextBox, and other classes in the .NET Framework class library.

Jeff Prosise

MSDN Magazine May 2001

drag and drop treeview node to textarea in web forms

Hi We have an asp.net treeview control and a texarea. The childnodes of treeview need to be draggable and can be dropped into txtarea.   Please let us know how it will be achieved through JQuery?

How to use single windows service to host multiple WCF Services instances (Each instance of WCF is i

How to use single windows service to host multiple WCF Services. I have a mutiple instance of same WCF service in different folder, each instance has unique service name and port. WCFService has reference to Reg-Free COM Reference, i have Native.WCFService.manifest in each folder. Ex: WCFService1 is in "C:\WCFService01\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config WCFService2 is in "C:\WCFService02\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config Now i need host above services from single Windows Service. I am trying to create AppDomain for each above WCFService Instance from Windows Service and then host. Its working if i register COM dll in the server using regsvr32, but when i un register COM dll, i am getting unable to load COM component .... This looks like AppDomain is not loading COM DLL and Manifest files. Its looks strange but we need it in this way because we have production and test environment in the same server. Everything works fine if create a seperate Windows Service for each WCFService Instance, but my manager wants single Windows Service :). Any help whould be really appreciated.  ravi kumar reddy

SharePoint upload files from windows explorer and emails from outlook by drag and drop

Guys, I need to have this functionality to upload files and mails by drag and drop, now sharepoint allows it by having that folderview in IFrame which takes the dropped item, but this does not allow files with spcial characters due to http URL related issue. How can I customize or program this to allow files with special chars in name, if not possible then how can I rename before the drop is over ? thanks, ram    

Drag and drop to windows explorer of SharePoint site leads to 0KB file


I believe this issue got by so many people already.

We have a sharepoint site running on HTTPS protocol. There are some scenarios we get multiple documents from customers and need to move them to SharePoint to share them across organization. For this, what we are doing is, we are opening the library and from Actions menu -> Open in Windows Explorer.

The windows explorer is opening fine and when we tried to move the files from local system to windows explorer of the SharePoint site, it is failing to copy data and showing 0KB moved. And at the windows taskbar it is giving notification like "Got network delayed write fail message." when we are doing this on XP. On any other OS, there is no notification and not moving the file.

We are not able to understand the problem. Why it is not able to move, everytime it is copying 0KB.

We can do using upload multiple files feature, but we have to go back and forth between folders and it will slow down the process.

Please help me out, why it is happening... It is not network issue at all for sure.


ASP.NET and SharePoint developer
Company: http://www.rampgroup.com/
Blog: http://praveenbattula.blogspot.com

drag and drop windows explorer view in moss


For uploading or copying large number of documents i can use windows explorer view in moss.

Is this view requires administrative permission.

Suppose i have a workflow for each document in the library,If i copy in bulk documents to the library.will the workflow be attached by default.

Any suggestions..

problem with connecting to local SQL Server 2008 default instance using windows authentication




I have a user getting some problem with connecting to local SQL Server 2008 default instance using windows authentication with a user which has sysadmin role and is owner of each existing database:

2010-09-28 15:40:35.04 Logon       Error: 18456, Severity: 14, State: 11.


2010-09-28 15:40:35.04 Logon       Login failed for user 'IIS APPPOOL\RoomViewSEWebClient'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT:]



This us

How to Install MSDTC on a multi Instance SQL Server Fail OverCluster (SQL 2005 & Windows 2003 R2 x64


I am installing 2 SQL instances on a fail over cluster.

Currently I have my Quorum and DTC resources on the default Group and the 2 sql instances on 2 other groups.

In this way would the DTC resource  be available for both the SQL groups or is there any other way i should go about doing this ?

Drag and Drop between windows and my project


Hello i am a basic programmer in visual basic 2010.

every place you go they wrote how insert a text format between your project (first textbox to second textbox) but i cant find how insert files from out of your form into your form.

for example how i should get file paths by using drag drop.

i want insert several files (Rar) into my form in my listbox

anybody can help me



Adding New Storage for new Instance in Windows 2003 Cluster environment.


Hello all

Part of Preparation for adding new Instance in Cluster I required

1. IP   - I got It

2. Network name    - I got It

3.free disk resources     - I got iSCSI drive but I have to intilize now.

Here my question is

I have to Intilize the "iSCSI" from Both ndoes or it is ok if I intilized from Active node.

Please advise me.

Thanks in Advance


Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

How to Localize Windows Forms and Change the Language at Runtime

Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

Localizing Windows Forms

The Visual Studio project system provides considerable support for localizing Windows Forms applications. There are two ways to generate resource files using the Visual Studio development environment: one is to have the project system generate the resource files for localizable UI elements such as text and images on the form. The resource files are then built into satellite assemblies. The second way is to add a resource file template and then edit the template with the XML Designer. A reason for doing the latter is to make localizable strings that appear in dialog boxes and error messages. You must then write code to access these resources.

This walkthrough topic demonstrates both processes in a single Windows Application project.

You can also convert a text file to a resource file; for more information, see Resources in Text File Format and Resource File Generator (Resgen.exe).


Activation error occured while trying to get instance of type Database, key "DBName"


Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />

Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)

Database myDB=EnterpriseLibraryCo
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend