I keep getting an error here - da.fill(ds, "table1") It looks good to me. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myconstring As String = WebConfigurationManager.ConnectionStrings("myConnectionString").ToString Dim mycon As New SqlConnection(myconstring) Dim selecteddate As String = "select [datetime], accountnumber from mytable where ([datetime] >= convert(datetime, '" & Trim(Date1.Text) & " 00:00:00', 101)) and ([datetime] <= CONVERT(DATETIME, '" & Trim(Date1.Text) & " 23:59:59' , 101 ))" Dim da As New SqlDataAdapter(selecteddate, mycon) Dim ds As New DataSet da.Fill(ds, "table1") - ----------- Incorrect syntax near '='. Me.GridView1.DataSource = ds.Tables("table1") Me.GridView1.DataBind() End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE