i want to compare between the cell value with the value(parameter) in database.
as example, if my cellvalue value is 3 and my paramater(a) in my database is 5 it will be like this
if cellvalue<a then
(some code)
end if
the problem is i don't know the exact data type. the reason i need to use data type is because my data is dynamic.
here is my code:
protected SubGridView1_RowDataBound(ByVal Sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Users\me\Documents\Visual Studio 2005\WebSites\CSG\CSG1.mdb")
con.Open()
detReport = New OleDbDataAdapter("Select * From parameterData WHERE (alert_ID = 'CR') AND (alert_type = alert_ID)", con)
Dim a As Int32
DetReport.Equals(a)
if e.Row.RowType = DataControlRowType.DataRow Then
Dim CellValue As Decimal = convert.ToDecimal(e.Row.cells(4).text)
if CellValue < a then
e.Row.Cells(4).BackColor = Drawing.Color.Red
End if
End if
con.close()
End Sub
i hope that you all can help me. thanks in advance :)