.net

What ORM would you choose for working with legacy databases ?

I am in the process of integrating a number of legacy systems. They each have different databases; and I will need to write data access code for most of them. The database schemas cannot be changed (I might be able to apply some indexes and such, but tables and their columns must retain the structure). Some of the databases has an OK de...

Loading Complete graph from Sql using LINQ

Assume we have a Menu class that has SubMenus (which is the same type of Menu therefore can have SubMenus and Items too) and Items (which has a different type) and we stored them in two tables(One for Menus and one for Items). Is there any way to load complete graph of the Menu class (all of its SubMenus and Items) using LINQ to SQL? ...

Update Counter on Thread in .NET

I am writing a server program that does some basic threading. It needs to update some UI controls and I learned how to use delegates such that everything is thread safe. For example, here's my delegate that allows me to update a TextBox control from a thread: Private Delegate Sub AddMessageToTXTDelegate(ByVal lst As TextBox, ByVal str...

Windows Mobile .NET Compact Framework

Is there any way, how to make Windows Mobile applications using WPF? If not, what book would you recommend for .NET Compact Framework 3.5 (C#)? ...

What is the difference between debug.write and Trace.write?

What is the difference between debug.write and Trace.write? When should each be used? ...

Send TAB to a child console (windows)

I create a child console application with _process = new Process(); _process.StartInfo.FileName = @"cmd.exe"; _process.StartInfo.UseShellExecute = false; _process.StartInfo.RedirectStandardInput = true; _process.StartInfo.RedirectStandardOutput = true; _process.StartInfo.CreateNoWindow = true; _proccess.Start(); Now I can go to c:\a...

Something like MEF (Managed Extensibility Framework) for .NET Framework 2.0

I used MEF in own of my projects and I liked it a lot. It was easy and after figuring our awkward API model, it just worked. Now I need something like that for .NET Framework 2.0. Is there any similar project out there which can work under .NET Framework 2.0? I'm simply looking for adding plug-in support to my project in a simple way. ...

cannot find xml path error

I feel kinda stupid to even ask that question, But i was sitting like an hour trying to figure out how to solve the problem. I am currently making a project that uses ASP.NET and XML, for my project i created new web site from Visual Studio, and trying to keep my XML files in App_Data. However when i trying to use code: var topic = fro...

Shouldn’t Bind() pass child control’s values to GridView before Page.PreRender?

hello, For controls such as the GridView, DetailsView, and FormView controls, data-binding expressions are resolved automatically during the control's PreRender event But doesn’t data source control perform updates prior to Page.PreRender event? Meaning, shouldn’t Bind() pass child control’s values to GridView ( so they can be pas...

How costly is adding an element to an ItemControl?

I just have a general .NET inquiry: Suppose I have a large (memory size) Class public class BigClass { ... } If I add an item to an ItemControl such as a ListBox or Datagrid like this BigClass b = new BigClass(); ListBox1.Items.Add(b); How is the resource usage in doing something like this? Is the added item referenced or is a cop...

Best Way to Horizontally AutoSize a WinForms TreeView Control?

Hello, I have a treeview control in WinForms that is filled from a wide variety of database content. I need to calculate the minimum width of the treeview control (after it is populated) so that horizontal scroll bars are not necessary to view the content. The calculation needs to account for the size of the longest text in the tree b...

UpdatePanels - Controls outside are re-rendered?

I have rather a complex UI page with several UpdatePanels nested. All of them are set to UpdateMode = "Conditional" I have a listbox outside all the updatepanels. It's strange how there's a flicker on these listboxes when any buttons within the UpdatePanels are clicked. My understanding was if the mode is conditional, this should not b...

Using two .NET libraries with the same namespace

I'm currently maintaining some old code for a company. As it would happen, the current app I'm modifying uses an older version of the in-house library (we'll call this Lib1.dll). They also have a new version of the library called Lib2.dll that improves upon the previous library in many ways. Unfortunately, Lib2 is not backward compati...

Testing exceptions

do you thing this is a good way for testing exception? any suggestions ? Exception exception = null; try { //I m sure that an exeption will happen here } catch (Exception ex) { exception = ex; } Assert.IsNotNull(exception); Im using MS Test ...

Displaying NOAA Charts in .NET

NOAA provides free nautical charts in two formats: 1) "NOAA Electronic Navigational Charts® (NOAA ENCs) are vector data sets that represent NOAA's newest and most powerful electronic charting product. NOAA ENCs conform with the International Hydrographic Office (IHO) S-57 international exchange format" 2) "NOAA Raster Navigational Char...

Is there a way besides Mono to run Microsoft .NET on a Mac or Linux?

I'm currently deprived from any Windows machine, and Mono doesn't run my application. Is there another way that might get around any reason why Mono wouldn't work? (I don't have the error message at the moment.) ...

How do I get out of PHP development and into .Net development?

I have a B.S. in computer science and have been working as a PHP developer for about three years. I don't want to be a PHP developer and would like to move into .Net development. I don't expect it to be easy, but I am prepared to do whatever it takes to make it happen. I'm confident in my ability to learn the tools, languages, and des...

Visual Studio 2008 express not recognizing my Sql Server 2008 express

I recently installed in order: Sql Server 2008 Express Visual Web Developer Express 2008 When I right click on app_data and try to add a db it returns: Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL: http://go.micro...

How can I set a foreground window if SetForegroundWindow and ShowWindowAsync doesn't work ?

It a is a c# winform app. I've set ShowInTaskbar prop to false because I don't want the program to appear in taskbar, but like this SetForegroundWindow or ShowWindowAsync don't work. ...

Ready-made animation libraries

I am looking for some progress animations to be shown in my WinForms application - so anything like AVI or animated GIF will do. The best would be animations depicting some "abstract" concepts, such as (for example) flying paper or animated 0s and 1s, to indicate progress. I know that Visual Studio 2008 comes with its own animation libr...