.net

How can I use a SqlConnection (ADO.Net) to connect to an ADO recordset?

I am having tough time since 2 days, and not able to figure out what should i do with my implementation. I am not sure if this could be really workable. Please help me on this. Below is my scenario: I have a .Net Dll which has a method that returns a SqlConnection object after opening it. Below is the function (similar to which i am u...

How can I bind an image MouseDown event with a RoutedUICommand

I have a RoutedUICommand that can be bind to multiple controls in xaml. I have a few Button controls and an image which should be bound to this Command. It's very simple to bind a command with buttons like <Button Name="btnAction1" Command="local:MainWindow.Command1"/> But I am unable to find a way to bind a mousedown event of image ...

How do I make a program "discoverable" on the network?

Hey guys, I was working on a simple chat program to brush up on my C#, and ran into a roadblock. I wanted to allow one computer to broadcast its location, and the other to find that computer, and display it (and any others) in a list.. Just a push in the right direction would be great, Thanks, Max ...

How do I filter a ListBox based on input from a TextBox?

i am new in programing i need help regarding how to filter listbox via using textbox in c# application. I mean enter some text into textbox and filter same time in listbox if items exits in lists then select into textbox else open new form for creating the items kindly give me example for the same. ...

XmlIgnoreAttribute, only used during serialization, not during deserialization?

Am I right in understanding the .NET XmlIgnoreAttribute, which says: Instructs the Serialize method of the XmlSerializer not to serialize the public field or public read/write property value. that: The property will be deserialized, if present in the XML file? The property will not be serialized to a new XML file? The reason I'...

Interleaving updates to a .net dictionary inside a tight loop

Hi All, I'm working on an application that does processing at what I'd call fairly high throughput (current peaks in the range of 400 Mbps, design goal of eventual 10 Gbps). I run multiple instances of a loop which basically just cycles through reading and processing information, and uses a dictionary for holding state. However, i als...

DoDragDrop - get target window handle

I'm using the following code to drag&drop data from listbox into other applications: Dim data As New DataObject(DataFormats.UnicodeText, ListBox1.Text) ListBox1.DoDragDrop(data, DragDropEffects.Copy Or DragDropEffects.Copy) How can I get a handle of the window that receives the data? I'm looking to build something like "Finder...

What is the Best Software For Implement Licensing System for My .NET Windows Application?

I Want Implement a Licensing System for my Application. I Use .Net Reactor Software for this And this Software can be Create a License File For My Application.But I Want a powerful Software for Implement Licensing System with Activation Code. ...

Is there a .NET porting of Domain Driven Design's "Time and Money" project?

Is there a .NET porting of Domain Driven Design's "Time and Money" project? ...

A VB Class File is not accessible ... Friend thing ...

a funny problem ... i can't understand it.. let me show you what i have first : 'D:\ReportsOfficesSystem\ReportsOfficesBLL\BaseController.vb' ^ ^ ^ solution project a vb class file and 'D:\ReportsOfficesSystem\ReportsOfficesDAL\ReportsOfficesEntities.vb' ...

Can the .NET OpenFileDialog be setup to allow the user to select a .lnk file

I want to show a dialog that will allow the user to select a shortcut (.lnk) file. My problem is that the dialog tries to get the file/URL the shortcut is pointing to rather then the .lnk file itself. How can I make it allow .lnk files to be selected? ...

Running DLR Embedded Scripts in Minimum Security Context

I need to get pointed in the right direction. I have embedded an Iron Python scripting host into a simple C# application, but now I need to know the best practices for locking down security on a user generated IronPython or IronRuby script. Specifically, what are the strategies for preventing library imports and isn't there a way in .NE...

replace slashes in .Net

I have a local file path containing "\" and I need to change all occurrences to "/" for a remote file path. I have tried myString.replace("\","/") and myString.replace(Convert.ToChar(92), Convert.ToChar(47)) Both seem to leave the "\" in tact.. Answer: NewString = myString.replace("\","/") The problem was that I was not assi...

Make an UI element transparent to mouse events

I have a lot of UI elements placed inside a canvas. Some of them are not supposed to handle mouse events while they can overlap with and cover other elements that must handle mouse events. When a mouse event occures, I want it to pass throuh all the elements that are not supposed to handle it to reach an element that might be covered by ...

MemoryStream mangles my XML? "hexadecimal value 0x0 is illegal in XML documents."

I am really a newbie with streams, so I don't really know what I am doing here. :) I have a XElement containing XML. I want it to return it as a file to the user. XElement xml = IndicesXMLGenerator.XML(); //Code for creating a memorystream for returning to browser as file MemoryStream stream = new MemoryStream(); XmlTextWrite...

Sorting GirdView via Sort icons how?

i read Matt Berseth article also i downloaded this source. But i can not do sorting event. Everything is ok but sorting is not working. A YUI DataTable Styled GridView protected void GvCustomers_RowDataBound(object sender, GridViewRowEventArgs e) { GridView gridView = (GridView)sender; if (gridView....

How do I remove some (or all) HTML elements and/or attributes using HTML Agility Pack?

Using the HTML Agility Pack, how can I remove all HTML attributes, elements, etc, etc, from a blob of HTML, with the result as if I pasted it into notepad? Additionally, I need to remove all formatting but I need to keep UL/LI and B tags. ...

Silverlight - How do you localize calls to WCF service?

I'm currently trying to find good way to make calls to WCF services in a way that will allow Thread on server to be aware of client culture. After spending couple days reading topics on the web it seems to me that the best way to do this is just to add (string clientCulture) to list of parameters of WCF methods; no longer: string HelloW...

Why doesn’t BeginInvoke return reference of type AsyncResult?

When you call a delegate object’s BeginInvoke, the system creates an object of type AsyncResult, but BeginInvoke returns a reference of type IAsyncResult interface ( which points to AsyncResult instance) . Why doesn’t BeginInvoke instead return a reference of type AsyncResult? thanx ...

How do I access a network drive through the usual System.IO classes?

My software handles multiple operations on files, and I have now finished writing the related functions, using the System.IO classes. I now need to add support for network drives. Using a mapping works very well (although Directory.GetFiles is a bit low, and I don't know why), but I'd now like to be able to deal directly with paths such...