Maximus007
Technical User
I have a drop menu that has "All" as one of the options for useres to select. Therefore if the user selects "All" then it displays all the data for the date range.
part of the code:
strSelect = ("Select * from IT_Servers where DateEntered Between '" & strStart & "' AND '" & strEnd & "' And Tech='" & strTech & "'")
ObjCommand = New SqlCommand(strSelect, ObjConnection)
ObjAdapter = New SqlDataAdapter(ObjCommand)
objdataSet = New DataSet
ObjAdapter.Fill(objdataSet, "IT_Servers")
DataGrid1.DataSource = objdataSet
RdCount = objdataSet.Tables("IT_servers").Rows.Count
If RdCount = 0 Then
Label1.Text = "No record was found for " & strTech & "!"
DataGrid1.Visible = False
Else
Label1.Text = RdCount & " records were found for " & strTech & "!"
DataGrid1.Visible = True
DataGrid1.DataBind()
End If
ObjConnection.Close()
End Sub
part of the code:
strSelect = ("Select * from IT_Servers where DateEntered Between '" & strStart & "' AND '" & strEnd & "' And Tech='" & strTech & "'")
ObjCommand = New SqlCommand(strSelect, ObjConnection)
ObjAdapter = New SqlDataAdapter(ObjCommand)
objdataSet = New DataSet
ObjAdapter.Fill(objdataSet, "IT_Servers")
DataGrid1.DataSource = objdataSet
RdCount = objdataSet.Tables("IT_servers").Rows.Count
If RdCount = 0 Then
Label1.Text = "No record was found for " & strTech & "!"
DataGrid1.Visible = False
Else
Label1.Text = RdCount & " records were found for " & strTech & "!"
DataGrid1.Visible = True
DataGrid1.DataBind()
End If
ObjConnection.Close()
End Sub