I finally got my query to work the way I want in SQL Server 2005 by adding a COLLATE SQL_Latin1_General_CP1_CS_AS.
However, when I move my SQL Statement into my vb.net code, I am getting different results in my Combo Box. It is like the Combo Box does not recognize the Case Sensitivity.
Code:
Imports System.Data.SqlClient
Dim CityDataSet As New DataSet()
Dim da As SqlDataAdapter
Dim cn As New SqlConnection()
cn.ConnectionString = Global.xxx.My.MySettings.Default.ConnectionString1
cn.Open()
da = New SqlDataAdapter("SELECT DISTINCT CONVERT(varchar(50), City) COLLATE SQL_Latin1_General_CP1_CS_AS AS City FROM Address ORDER BY City", cn)
da.Fill(CityDataSet, "Address")
CityComboBox.DataSource = CityDataSet.Tables("Address")
CityComboBox.DisplayMember = "City"
CityComboBox.ValueMember = "City"
cn.Close()
Thanks in advance
However, when I move my SQL Statement into my vb.net code, I am getting different results in my Combo Box. It is like the Combo Box does not recognize the Case Sensitivity.
Code:
Imports System.Data.SqlClient
Dim CityDataSet As New DataSet()
Dim da As SqlDataAdapter
Dim cn As New SqlConnection()
cn.ConnectionString = Global.xxx.My.MySettings.Default.ConnectionString1
cn.Open()
da = New SqlDataAdapter("SELECT DISTINCT CONVERT(varchar(50), City) COLLATE SQL_Latin1_General_CP1_CS_AS AS City FROM Address ORDER BY City", cn)
da.Fill(CityDataSet, "Address")
CityComboBox.DataSource = CityDataSet.Tables("Address")
CityComboBox.DisplayMember = "City"
CityComboBox.ValueMember = "City"
cn.Close()
Thanks in advance