.net

Windows.Forms.ListView - Multiple selection in different groups

I have a ListView control with grouped items in it. My goal is to enable multiple selection only inside one group - the user should not be able to select any items except from those from the current group. My first thought is on canceling some event (something that happens before the item is selected), but I can't find the right one. T...

ESRI: ADF + Geodatabase

Hi, I'm a .NET Develop. I'm using ESRI / ADF and I have a problem whit some methods of Geodatabase. On the beginning of development I needed connect on GeoDB and execute queries. On this moment I got this error, ACCESS DENIED: (Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) So I solved this, creating my IWorksp...

Loading Windows form with over 200 controls

My form has over 200 control(s)! It takes about 7 seconds to load the form and bind the controls. I've traced the application with some performance profilers , but I didn't find anything with HOT flag except the constructor's of form. I would like to know that is it possible to call InitializeComponent method with sth like backgroundWo...

Form_Load() 'event' or Override OnLoad()

I would like someone to try and explain the difference between these. More specifically, example usage scenario's. I am refactoring some Windows Form code and a Form has some code in the Form_Load() event and also in a protected override void OnLoad() event that calls base.OnLoad(e); Now I traced it and the Override fires first and ...

Do you need to specify to use the latest framework version?

Have a project compiled to use (TargetFrameworkVersion) framework version 3.0 however it looks like there are some bug fixes in the latest v4.0 framework and HF. As we want the app to be available even if it is leaking a bit on the earlier frameworks, we don't want to just set the target to 4.0. When you browse the project you can see ...

Would .NET be able to function just as well without the use of type Object?

I am asking this because it seems like using Object seems to be an easy way out to solve certain problems, like "I don't have a specific type, so use Object", etc. Also the reason this made me curious is because a colleague of mine told me that if .NET was a true object-oriented platform then it wouldn't have to have a catch all type li...

translating line of code from C# to IronPython

I need to convert this line of code from an asp.net c# page to asp.net IronPython, how would it be? ((IPostBackEventHandler)Button1).RaisePostBackEvent(null); ...

Does Form.Dispose() call controls inside's Dispose()?

When I create a Form, the auto-generated code doesn't include an overrided Dispose method. Does that mean Dispose is not being called for all the controls in the form? ...

Why is WebBrowser.Dispose() launching Internet Explorer?

I have a Form that contains a WebBrowser. Sometimes, when calling it's Dispose method, Internet Explorer opens and loads the page that was loaded in my WebBrowser. Any idea what's going on here? ...

Is there a way to detect a setup version from a product ?

so, here is the situation here. I have 2 asp.net websites + some winform applications that are installed with a setup. They are all represented as merge modules into the setup project. Currently when we want to update the global version of the application we must update all versions into asp.net websites and stuff. I know it is possibl...

Entity Framework - Eager loading related entities

I'm using Entity Framework 4 with MVC and need to ensure any referenced entities I want to use in my view have been loaded before the controller method returns, otherwise the view spits out the dreaded: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection. When selecting s...

Why is sometimes WebBrowser.Dispose() launching Internet Explorer?

When I do the following (Actually I repeat the same whole code with different web pages): Navigator nav; nav = new Navigator(); nav.Browser.Navigate("http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&unfiltered=1&field-keywords=&field-author=&field-title=&field-isbn=0471848...

How to XML-serialize a dictionary

I have been able to serialize an IEnumerable this way: [XmlArray("TRANSACTIONS")] [XmlArrayItem("TRANSACTION", typeof(Record))] public IEnumerable<BudgetRecord> Records { get { foreach(Record br in _budget) { yield return br; } } } However, I realised that now I need a dictionary contai...

Copying all the checkout files

Hello, I am using Team foundation system and I have requirement in which I want to copy all the checkout files to a local folder along with the same folder structure using C#. How can I do that? Huzaifa ...

How do I access special directories in Windows?

What is the C# syntax to retrieve the user's desktop, documents folder and other system folders on windows? ...

Need to create a log-prob chart in .NET

I can create a chart with a logarithmic scale on one axis, but I need to have a probability scale on the other axis as well. Thanks in advance. ...

Current url into cookie file.

Short question is : "How do I save current url into cookie file?" And the whole problem is as follows. I have to save current filters that client have applied to my grid in his cookie, that next time he logs in the data looks just as he wants it to look like. The service doesn't have any "login" stuff, just provides available data to th...

Sync data between two Oracle db tables

I have to sync data from one Oracle db1 table tb1 to another db2's table tbl2. To keep simple, I can truncate data on db2 tbl2 and then copy all the data from db1 tbl1. Both tables have the same data column structure. Since two tables are on different databases, I am thinking to use a media file like txt or xml as a media. I export data...

Dynamically add item to DropDownList??

I have an Edit page in my application that contains a DropDownList. This DDL is bound to an EntityDataSource that only shows the active "ProjectManagers". In the case where the user is editing a record that is assigned to an "inactive" ProjectManger, an ArgumentOutOfRange Exception is (rightfully) thrown by the DDL (because that Item w...

C# equivalent to PwdCompare

I have a database where I'm storing a username and password. I'm using the PwdEncrypt function to save passwords as a varbinary(255) field. Now, I'm needing the ability to save this information locally in an XML file and for me to do a PwdCompare in C# on the client. Is there a way to do this? ...