Because when you databind the data to the control, all previous data gets wiped out, so you have to add the new item afterwards. Also, it will appear at the end of the list. I don't know of a way around that.

This code adds and selects an empty list item:

nameList.DataSource = MyDataTable
nameList.DataTextField = "Name"
nameList.DataValueField = "ID"
nameList.DataBind()
nameList.Items.Add("")
nameList.Items.FindByText("").Selected = True

Tip Submitted By: David McCarter


 
Categories: WinForms

September 9, 2003
@ 01:18 AM
Categories: dotNetDave | Link | Web Services | XML

Just use the code below. I'm sure you will want to replace the hard-coded values with parameters from a method.

Dim mailProcess As New Process()
Dim processInfo As New System.Diagnostics.ProcessStartInfo()
  processInfo.FileName = "mailto:someone@someone.com?" _
                            & "cc=someoneelse@someone.com&" _
                            & "subject=Sample Subject&" _
                            & "body=Body of Message"
  processInfo.UseShellExecute = True
  processInfo.WindowStyle = ProcessWindowStyle.Normal
  mailProcess.StartInfo = processInfo
  mailProcess.Start(processInfo)

Tip Submitted By: David McCarter

This code can be found in the open source dotNetTips.Utility assembly


 
Categories: VB.NET

September 6, 2003
@ 12:12 AM

What does it mean to give MORE than 100%?

Ever wonder about those people who say they are giving more than 100%? We have all been to those meetings where someone wants you to give over 100%. How about achieving 103%?

Here's a little mathematical formula that might help you answer these questions:

What makes up 100% in life?

If:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z is represented numerically as: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  25 26.

Then:

H-A-R-D-W-O-R-K (mathematically) is... 8+1+18+4+23+15+18+11 = 98%

and

K-N-O-W-L-E-D-G-E is 11+14+15+23+12+5+4+7+5 = 96%

But,
A-T-T-I-T-U-D-E is 1+20+20+9+20+21+4 5 = 100%

And,
B-U-L-L-S-H-I-T is 21+12+12+19+8+9+20 = 103%

AND, look how far ass kissing will take you:
A-S-S--K-I-S-S-I-N-G is 1+19+19+11+9+19+19+9+14+7 = 118%

So, one can then conclude with mathematical certainty that: While hard work and knowledge will get you close, and attitude will get you there, bullshit and ass kissing will put  you over the top!!!


 
Categories: Geek Humor