Archive | Problems and Solutions RSS feed for this section

How to run or deploy a .Net application without .Net framework installed?

29 Nov

Sometimes you may need to let user run your .Net application without installing .Net framework.
There are several tools called “.Net Linker” which pack a .Net application with all needed files into a single package.

Here are some of them:

DataBound ComboBox Problem

3 Feb

When you want to use a data bound ComboBox in .NET (C#, VB, etc), you should set a few properties such as DataSource, DisplayMember and ValueMember.
It works fine unless you want to set SelectedValue for the first time. It won’t be set!

I found that BindingContext property must be created before initializing SelectedValue:

ComboBox1.BindingContext = new BindingContext();
ComboBox1.DataSource = MyDataSet.DefaultView
ComboBox1.DisplayMember = "Title";
ComboBox1.ValueMember = "Code";
ComboBox1.SelectedValue = 1;
%d bloggers like this: