[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/09/2009 at 06:27AM PDT, ID: 24799140
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Dropdownliast proper case

Asked by lrbrister in Programming for ASP.NET, Microsoft Development, .NET

I have a dropdown list that is working fine(Code attached)

But the characters are all in upper case.
I have a function that changes the case to proper in text boxes, labels, etc...but I can't get it to work in the ddl.
I'm trying to proper case the "StateName"
1:
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:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
---DROP DOWN LIAST CODE
 Private Sub LoadStates()
        Dim dbCon As New System.Data.SqlClient.SqlConnection
        Dim objCmd As New SqlClient.SqlCommand
 
        dbCon.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("strConn")
        dbCon.Open()
        Dim adapter As New SqlDataAdapter("select * from states where countryCode = 'US' and StateCode not in ('UM', 'AS', 'GU','MP','PR','VI' ) order by StateCode", dbCon)
 
        Dim dt As New DataTable()
        adapter.Fill(dt)
        dbCon.Close()
        ddlState.DataValueField = "StateCode"
        ddlState.DataTextField = ProperCase("StateName", True)
        If Request.QueryString("st") = "0" Then
        Else
            ddlState.SelectedValue = Request.QueryString("st")
        End If
        ddlState.DataSource = dt
        ddlState.DataBind()
        ddlState.Items.Insert(0, "--Select--")
    End Sub
 
 
---PROPER CASE FUNCTION---
Public Function ProperCase(ByVal strText As String, Optional ByVal blnProperCaseAllWords As Boolean = False) As String
        Dim strReturnValue As String
        Try
            If blnProperCaseAllWords Then
                strReturnValue = StrConv(strText, VbStrConv.ProperCase)
            Else
                Dim strBuilder As New System.Text.StringBuilder
                strBuilder.Append(LCase(Trim(strText)))
                strBuilder.Chars(0) = UCase(strBuilder.Chars(0))
 
                Dim arrEndChars(2) As String
                arrEndChars(0) = ". "
                arrEndChars(1) = "! "
                arrEndChars(2) = "? "
 
                strReturnValue = strBuilder.ToString
                For i As Integer = 0 To UBound(arrEndChars)
 
                    Dim intStartPos As Integer = 1
                    While strReturnValue.IndexOf(arrEndChars(i), intStartPos) > 0
                        Dim intIdx As Integer = strBuilder.ToString.IndexOf(arrEndChars(i), intStartPos)
                        strBuilder.Chars(intIdx + 2) = UCase(strBuilder.Chars(intIdx + 2))
                        strReturnValue = strBuilder.ToString
                        intStartPos = intIdx + 2
                    End While
                Next
            End If
 
        Catch ex As Exception
            strReturnValue = strText
        End Try
 
        Return strReturnValue
    End Function
[+][-]10/09/09 06:43 AM, ID: 25534850

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/09/09 06:53 AM, ID: 25534954

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/09/09 07:21 AM, ID: 25535236

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/09/09 07:26 AM, ID: 25535294

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/09/09 07:37 AM, ID: 25535440

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/09/09 07:40 AM, ID: 25535469

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/09/09 07:41 AM, ID: 25535481

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Microsoft Development, .NET
Sign Up Now!
Solution Provided By: princeatapi
Participating Experts: 3
Solution Grade: A
 
 
[+][-]10/10/09 07:55 AM, ID: 25542494

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_EXPERT_20070906