.net

environmental configurations

What's the best way to modify web.configs (and other XML based configurations)? I'm needing to automatically apply certain settings based off environment. ...

Is it possible to set the parent of a .NET WinForm to a native app?

Is it possible to set the parent of a .NET WinForm to a native app? So it acts like its child window? ...

Linq: Get a list of all tables within DataContext

I have a DataContext (Linq to Sql) with over 100 tables, is it possible to get a list of all those tables and lets say print them to the console? This might be a silly question. Thanks. ...

Tools to help me generate an xml schema for a mssql database?

I'd like to be able generate an xsd of my MSSQL database's structure. Are there any tools or libraries that help me to this? The VS designer for typed datasets come's close, but I'm looking for a programmatic approach. ...

C# Variable labels?

Say I have a box that says ENABLED or DISABLED. How can I make the text vary depending on a state? ...

Populating Nested Repeater Drop Downs C# .NET Linq

I have nested repeaters that create a table with each cell consisting of 3 drop downs. I set the selected value of the drop downs by looping through the repeaters and assigning them to the result of a linq statement. The number and characteristic drop downs work fine, but the make drop downs all get set to the last value assigned. Doe...

C#: Is there a way to properly convert Keys.Oem? to proper string without doing string manipulation?

C#: Is there a method to convert Keys.Oem? to proper string without doing string manipulation? When I do e.ToString() and if the key is a / or <, and so on, it converts as OemSlash, OemQuestion. Is there a way .net method properly convert Keys.OemSpace to "Space" without it including "OemSpace" and without string manipulation? And if th...

Updating Custom Attached Property in Style Trigger with Setter

Hi All, I was trying out attached properties and style triggers hoping to learn more about it. I wrote a very simple WPF windows app with an attached property: public static readonly DependencyProperty SomethingProperty = DependencyProperty.RegisterAttached( "Something", typeof(int), typeof(Wind...

Pointing a Domain to a IIS Site's Sub Folder

Hey All, Sorry for the possibly misleading title of this post. Couln't really think of anything better at the moment. Anyway, I have a site set up that allows users to search our customer database. I have a separate section of this site listed under a "reports" directory, which is used to generate billing reports, subscriber counts, ...

ThreadA and ThreadB both call WaitOne() in that order on the same AutoResetEvent - when the event is set, why does ThreadB get released instead of ThreadA?

I ran a test to find out what happens when you set an AutoResetEvent on which mutiple threads are waiting: private static void Test() { // two threads - waiting for the same autoreset event // start it unset i.e. closed i.e. anything calling WaitOne() will block AutoResetEvent autoEvent = new AutoResetEve...

How to deserialize somewhat incompatible BinaryFormatter data?

I have an inherited code base that was developed in .NET 1.1. When I migrated it to 2.0, I renamed an assembly. Now, I find that it will be necessary to read old files containing objects serialized by the old assembly and .NET 1.1. Some fields are successfully deserialized, but most are ignored. If I enable FormatterAssemblyStyle....

Parse Delimited CSV in .NET

I have a text file that is in a comma separated format, delimited by " on most fields. I am trying to get that into something I can enumerate through (Generic Collection, for example). I don't have control over how the file is output nor the character it uses for the delimiter. In this case, the fields are separated by a comma and tex...

Need ad-hoc reporting component

We need some simple ad-hoc reporting solution for our ASP.NET web-site. Just an ability to build a query with user friendly interface, then show the result of this query in some table and maybe export it to Excel or print. The solution must be quite easy for end users (our site visitors) who know nothing about databases, SQL and other ...

How to prevent data loss in a .net application due to sudden power failure?

We are developing an RetailPOS .net (windows) application. One of the customer asks 'What will happen to current data being processed in the application when a power went off suddenly?', 'Will the application able to recover the unsaved data?' I am wondering, how this feature can be included in the .net application? Can some help m...

How do I create a custom System.Windows.Media.Brush?

I can't find any documentation on implementing a class that inherits System.Windows.Media.Brush - what would it need to provide to do the job? My specific goal is a triangle gradient; I can handle the details of calculating the colors if I can just find out how to actually implement a new brush. ...

Default values from SQL Server Express table column to Dataset?

Hi, I am a new Database programming learner. I am using C# (.NET 3.5) along with SQL Server Express. I am following Forms over Data Video Series from Microsoft. However, I am creating a databse, different from the one created in the videos. In one of the tables, I wanted the present date/time to be inserted in the date column, so I am...

Instantiating custom .NET types in IronPython

Assume the following code: public class Foo { public string Bar { get; set; } } How can I instantiate an instance of Foo in the following code? ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null); ScriptRuntime runtime = new ScriptRuntime(setup); ScriptEngine engine = Python.GetEngine(runtime); ScriptScope scope = engine.C...

How to use Namespaces of .Net in C++???

How do I make use of the .NET framework namespaces from C++? ...

SqlConnectionStringBuilder form in .net C#

I am wondering how I can add DATA LINK form to my WIN application. You know those forms where Users can choose on witch SQL server they going to connect and what type of security they going to use and on wht database. Something like on this picture ...

Should I call my validation script in the prebuild section of my ccnet.config?

I have a ccnet.config section which I had implemented for a demo purpose. So I have a simple validation check which is done before my build is being triggered. So if the validation passes then my build starts of successfully.So validation check is to count the number of '#defines' present in a single .c file which is a.c for example. I h...