.net

Multiple .NET Configuration Files and Setup Project Problem

In order to handle settings for different deployment targets, I moved application settings from app.config to its own file and included that file in app.config via configSource. I also created a settings file for each target.Here is an illustration: Project A app.config (references settings.config) settings.config settings.Rel...

Get the Assembly path C#

Hello, Im trying to know the path of a dll.... several sites says that ive to use System.Reflection.Assembly.GetExecutingAssembly().Location BUT it returns a path in C:\Windows\Microsoft.Net ... etc... \File.Dll and i want c:\MyProyect\MiWeb\Bin\File.Dll any help ? ...

Arithmetic Operators vs Methods in Class Design Guidelines

I have many math types like Point3, and I am running into the dilemma of implementing operators, instance and static methods for arithmetic. So say the type is Point3. Where a, b, c is a Point3, I sure wanna be able to say: c = a + b; But should I also implement: c = Point3.Add (a, b); And this: c = a.Add (b); To me #3 is usele...

My Dynamic Data Enttiy wep App. does not include App_code?

i asked: There are Two kind of template in asp.net 3.5 1) Dynamic Data Web App. 2) Dynamic Data Web App. Entities My SQL database has got Customer Table ; Columns : ID, Name,Surname vs. if you use first one(Dynamic Data Web App); you can not see ID column(Customer Table) (Linq to Sql) But if you use second one(Dynamic Data Web App....

How to use assembly without Strong Name in SSIS

I want to use a assembly in a SSIS task. However, it is unsigned and third-party. Therefore, I can't GAC it. What workarounds are available? ...

Project Settings and Not set to an instance error

I am hoping someone can help point me in the right direction. I was having a StackOverFlow error with my Settings.Designer.cs file. I manually regenerated the file according to this post HERE Now my Designer file looks like it is supposed to, so they tell me, but everywhere in my Class Library(30 places) that was accessing the Settings...

Auto resolution text box control for .NET Windows Forms

I need to create a text box which will auto resolve what the user types based on a list of values, something similar to the "To" field in e-mail clients. For example, my list has these values: Car House Tree Typing "hou" would automatically resolve to "House", and trying to delete a single letter (with backspace or delete) of that wor...

Dynamic Data App_code directory - where is it?

i try to learn learn Dynamic Data Entties . i see some sample about it. they try to teach some codes in App_code. i really want to learn where is my Ap_code? ...

Does .net interop do cross-thread marshalling for COM or do I need to use CoMarshalInterThreadInterfaceInStream or similar?

Can anyone give me a definitive answer as to whether I need to use something like CoMarshalInterThreadInterfaceInStream, CoGetInterfaceAndReleaseStream or GlobalInterfaceTable to marshall a COM interface between threads? In this thread some say interop does it for you, some say you need to use these calls. Which is it? Specifically I'm ...

Entity Framework: Private Setter on an Abstract Class

We have an abstract class where all properties have private setters. In our concrete derived class, the code generator is creating a static “create” method that attempts to set the properties of the abstract class. Obviously this fails since the setters are private. How do we suppress the creation of the “create” method? ...

Implement thread-safe collection for data-binding in .NET

I have a Windows Forms application that displays a form with a DataGridView bound to a custom collection that inherits BindingList. I'm using the BindingSource / DataSource mechanism for data-binding. The form is a monitor that displays status information contained in the collection. Each element of the collection represents status in...

How can I limit file fragmentation while working with .NET?

In my application I am gathering small data bits into a bigger file over time. As a result, the target file becomes excessively fragmented. What can be done to limit fragmentation of the output file with .NET? ...

Should I Use TDD?

I'm the only developer in my (very small) company and I'm about to start on a medium sized ASP.NET web application for said company. I'm trying to figure out if I should learn Test Driven Development (TDD) and implement it in this application. I need to start developing our new application shortly and I'm worried about testing. I've ...

Implement thread-safe collection for data-binding in .NET

I have a Windows Forms application that displays a form with a DataGridView bound to a custom collection that inherits BindingList. I'm using the BindingSource / DataSource mechanism for data-binding. The form is a monitor that displays status information contained in the collection. Each element of the collection represents status in...

VB.NET: Is there a way to reduce the lag of loading a huge list of text lines to a listbox?

I am using file.readalllines to read the file into a string, then using listbox.items.addrange and splitting by vbcrlf to insert the items. Is there a way to reduce the lag it causes for loading huge lists? ...

Any Free Alternative to the ASP.net Calendar Control?

Here are the problems I am having with the control from the factory: no easy way to get the first visible date (yeah I could use day render, but at that point in the page cycle, I can't do what I need to, which is manipulate a collection in viewstate) changing the visibledate property in my code does not raise the visiblemonthchanged ...

Func delegate with no return type

Rewritten: All of the Func delegates return a value. What are the .NET delegates that can be used with methods that return void? ...

What happens during the garbage collection when 2nd generation is full

Hi guys. I'm rereading CLR via C# right now and have some thoughts about garbage collection routine. In book, after zero generation is filled, garbage collection starts and moves all "not garbage" references to the first generation. The same happens when the first generation is filled. But what happens when second generation is filled? T...

LINQ - Dynamic OrderBy in VB.Net

I am trying to do something similar to this sample code from Phil Haack to VB, and LINQ Orderby is giving me problems - and I can't figure out how to do this. Entire method posted for completenes. This is the C# version: public ActionResult DynamicGridData(string sidx, string sord, int page, int rows) { var context = ne...

Is using a GUID a valid way to generate a random string of characters and numbers?

Possible Duplicate: How Random is System.Guid.NewGuid()? Based on this question I would like to know if using a GUID to generate a random string of characters and numbers has any flaws in it? So, for example, if I wanted a random string of characters and numbers of 32 or fewer characters I could use the following C# code: stri...