ASP.Net – Add a default value to a binded dropdown list

Hello, today you will learn how to add a default value such as “select a value” to the top of your bound dropdown list in vb.net. I am not going to show you how to bind your dropdown list, you can do that by searching this in google if you do not know how to do this.

After your dropdown list has been bound, you should use the following code after you close your connection to the database.

Dim Item As ListItem = New ListItem Item.Text = “select a value” Item.Value = “0″ Item.Selected = True BoundDropDownList.Items.Insert(0, Item)

Hope this helps.

... Read More

VB.net: Capitalize first character in each word.

Dim strHockey As String = “vancouver canucks” strHOckey = StrConv(strHockey, VbStrConv.ProperCase) MsgBox(srtHockey)

Output will be Vancouver Canucks

... Read More

Setup mysql with asp.net

Introduction

Back in the days of classic ASP, if you were building a database-driven web site, your choice was either to invest a lot of money to get a copy of Microsoft SQL Server (or some othe enterprise-ready database) or invest a lot of time finding a way to deal with the performance and scalability limitations of Microsoft Access. Luckily these days there’s another viable alternative: MySQL.

Click here to get more information on how to set this up with asp.net.

... Read More