Tengo el siguiente codigo..me marca error cuando hago la consulta..
Conversion failed when converting date and/or time from character string
alguien sabe por que pueda ser.?..gracias
Dim DS2 As DataSet
Dim MyConnection2 As SqlConnection = New SqlConnection("Data Source=xx.xx.xx.xx;Initial Catalog=xx;User ID=xx;Password=xxx")
MyConnection2.Open()
Dim MyCommand2 As SqlDataAdapter
Dim suborden2 As String
MyCommand2 = New SqlDataAdapter("select SUM (VENTA) from SALES2 where SID =1 and [idate] >= @idate", MyConnection2)
Dim dt As New DataTable
MyCommand2.SelectCommand.Parameters.AddWithValue(" @idate", DateTimePicker1.Text)
DS2 = New DataSet()
MyCommand2.Fill(DS2, "venta")
Label1.Text = DS2.Tables(0).Rows(0)(0).ToString()
'DataGridView1.DataSource
MyConnection2.Close()