Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use compare validator

Status
Not open for further replies.

josie2007

Technical User
Apr 14, 2007
90
US
I would like to use compare validator to compare the values for two dropdown controls. the field that I would like to use is not DataValueField or DataTextField
 
sorry, I was not clear with my question.
I am not sure if I could use compDate field from the database selection to compare the value to the other dropdown control.


Sub StartlettingDate()
Dim connectionString As String = ConnectionStrings("ConnectionString").ConnectionString
Dim oOracleConn As OracleConnection = New OracleConnection(connectionString)

Dim strStringBuilder As StringBuilder
strStringBuilder = New StringBuilder
With strStringBuilder
.Append(" select distinct trim(to_char(b.datelet ,'fmMonth ddth yyyy')) DateForLetting , to_char(b.datelet, 'MM/DD/YYYY') compDate, b.datelet datelet ")
.Append(" from bidlet b , letprop l ")
.Append(" where datelet > to_date('12/31/2004','MM/DD/YYYY') ")
.Append(" and datelet < trunc(sysdate) ")
.Append(" and l.letting = b.letting ")
.Append(" AND SUBSTR (l.lcontid, 4, 4) <= '5' ")
.Append(" order by 3 DESC ")
End With
Dim cmdLetting As OracleCommand = New OracleCommand()
cmdLetting.Connection = oOracleConn
cmdLetting.CommandType = CommandType.Text
cmdLetting.CommandText = strStringBuilder.ToString
Dim adLetting As New OracleDataAdapter(cmdLetting)
Dim dsLetting As New DataSet
adLetting.Fill(dsLetting, "LettingDate")
ddLetting.DataValueField = "datelet"
ddLetting.DataTextField = "DateForLetting"
ddLetting.DataSource = dsLetting
ddLetting.DataBind()
End Sub
 
You can't use a compare validator that way, the validator validates a control.
 
thank you jbenson001 for response.I just twicked my query a little bit and I am able to use compare validator now. thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top