.net

Create control dynamically from Sql but I can not take text value?

I try to fill listbox. I generated textbox and labels from database. (My platform asp.net) I dynamically filled the created textbox. I want to send all data from textboxes to listbox. But disappear all datas. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.We...

Adding elements to the Header of the masterpage from contentplaceholder in .NET

Hi guys, I'm with a problem The scenario is the follow: After submitting a form the user recieves one message says OK, and is redirected to another page after 2seconds. The problem is, when insert is sucefully, i add to the header of the masterpage a HtmlMeta element, but when i'm inserting from the contentplaceholder, i recieved a f...

Integrating "Help" into WinForms Application

I am working on a Visual Studio we need to integrate help menus into it. I would like to do this in the canonical Windows fashion but am not very experienced with the .NET framework in these respects. Searching Google and SO hasn't yielded much because most of the results are people asking for help, not help with "help." Meta-help, if yo...

Referencing 2 differents versions of log4net in the same solution

I'm using NHibernate 2.1.2.400 that is referencing log4net 1.2.10.0. In the same project, I also use the simply accounting SDK, sadly it is still using log4net 1.2.9.0. So I can get NHibernate to work if I reference log4net 1.2.10.0 but the simplySDK don't work. And vice versa... I'm guessing most of the problems come from the fact th...

extract email contents using c#

i have a file which contains email message. i was wondering if there is any built in library or class in .net that would allow me to directly extract contents of email something like this Library lx= new Library("email_file"); Console.writeline(lx.From ()); Console.writeline(lx.To()); file attachment=lx.attachment(); I have written ...

Strange decompiled code from event subscribe code in a generic class

This simple class public class Test<T> { public static void A(Window wa, Window wb) { wa.Closed += (s, e) => wb.Close(); } } Gets compiled to this (I'm using Reflector to decompile) : public class Test<T> { [CompilerGenerated] private sealed class <>c__DisplayClass1 { public Window wb; ...

Check internet connection in Silverlight

I'm writing a Silverlight 4 application and would like to check when opening the installed out of browser application, whether there is a valid internet connection (to then download some data from my website). What is the best way to do this? I realise that I could put a try catch around a WebRequest but that seems a bit hacky to me. ED...

Any advantage to objects.GetObject(i) over objects[i]?

I'm refactoring a little bit of C# data access code from a previous developer and am curious about a pattern he used. The code initially exposed collections (arrays) of a variety of ActiveRecord-style business objects - essentially objects wrapping database fields. I'm changing the arrays to generic lists, but the aspect of the code I'...

Binding to a value that gets updated in the ViewModel in MVVM?

I'm new to MVVM. I have a label in my view that looks like this: <Label Content="{Binding Path=ClockTime}" /> And my ViewModel looks like: Public Class MainWindowViewModel Inherits ViewModelBase Dim strClockTime As String Dim dstDispatcherTimer As New Windows.Threading.DispatcherTimer Public Sub New() AddHandler dstD...

How do I create a simple Web Server using WCF without the ServiceHost class?

I've began to learn WCF and wish to understand its internals by creating a simple Web server using channel stacks directly. I have found a lot of theory in the web but I'd like to see a working sample code of receiving and responding an httprequest that I can test using any browser. I'm hoping for something that shows the setup of a cu...

Can I force a program to load a weakly-named assembly when it's linked to a strongly-named assembly?

Hey I have a program that references a strongly named assembly which is in the gac. I have a debug build of this assembly which I want to debug into, but it isn't strongly named. Can I use a policy file or something to force the program to use the weakly named assembly? Or do I have to recompile the program to reference the weakly na...

Options for WYSIWUG Form data entry on web

I'd like to have close to WYSIWYG form entry on the web. Turbo Tax does this. Basically government forms so would like them to be as close as possible to the paper look. Results go to a DB. PDF looks nice but does not seem to give complex validation (if field1 set, enable group input). Fast is always a plus. (IIS, .net). What options fo...

How can I display different values in a DataGridViewComboBoxColumn drop list than in the text box?

I have a DataGridViewComboBoxColumn where I'm supposed to display different values than are selected, much like what's going on in this question: http://stackoverflow.com/questions/1390462/datagridviewcomboboxcolumn-name-value-how In my case, I'm displaying lists of equipment which have an ID and a description. So my bound data class l...

Multiview returns to first view

Hi, I have a .net page with a multiview control. In the first "view" I have a form users need to fill in (data is stored in database), a second "view" brings a 'thank you' message and the ID just created. It works ok. The thing is that I added a 'print this page' link in the second "view " so users can print their IDs (they also reciben...

C# databinding of class variables.

Hello All, I'm really falling in love with the whole .Net databinding scheme... but apparently there are still a couple of gotchas out there. Let's say that my class has a member variable of type double named Susan. Well there seems to be no immediate way to bind Susan to a text box SusanText because the binding looks something like t...

How to unit test a class using System.Windows.Threading.Dispatcher

How do I unit testing a class which makes use of System.Windows.Threading.Dispatcher? I am following the MVVM pattern in the setting of WPF. As part of this I am creating a DispatchingBlah class following the pattern used for DispatchingQuoteSource that I saw in this video (see 1:06:16 ish). I want to test that my class has queued the...

how to know about the type of com server using type library?

Hello, Is there any attribute or property or method available in type library which tells that whether given type library is in proc COM server or Out of proc COM server. Regards Usman ...

DataAdapter.Fill to specific table in dataset

I am trying to make use of DataAdapter, unfortunately stuck with straight ADO.Net, and all of the examples I see have a call like this: dataAdapter.Fill(dataSet, "TableName"); I want to do a fill in that manner, meaning the data goes into a named table, so that I can properly manage the tables later on in the cycle. Unfortunately, it...

Framework for distributed computing for .Net / Mono that supports persistence of distributed tasks

I'm looking for a framework (open source) for distributed computing for .Net / Mono that is not simply task-based but supports persistence of distributed tasks. The project at hand is a complex system simulation which needs to be distributed into smaller independent "subsimulations". These subsimulations will keep running for a long tim...

How can I find a parameter's original variable name as a string at runtime ?

I got in Form_Load : for (int i = 1; i < 10; i++) { this.Controls["txtPrix"+i].Enter += new EventHandler(DlgFacture_Enter); } I got the event : void DlgFacture_Enter(object sender, EventArgs e) { this.setTextBoxPrixEnter((TextBox)sender); } In that last event, I want to be...