Dim conn As SqlConnection = CreateConnection()
Dim selectSQL As String = "SELECT * FROM [dbo].[Events] where EndDate between EndDate And @EndDate "
Dim custDA As New SqlDataAdapter
Dim ds As New DataSet
Dim selectCMD As SqlCommand = New SqlCommand(selectSQL, conn)
custDA.SelectCommand = selectCMD
' Add parameters and set values.
selectCMD.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = DropDownList1.SelectedValue
''' "2/1/2010 12:00:00 AM" '
Dim custDS As DataSet = New DataSet
GridView1.DataSource = ds
String was not recognized as a valid DateTime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: String was not recognized as a valid DateTime.
Line 184: Dim custDS As DataSet = New DataSet
Line 185: custDA.Fill(custDS, "Events")