This error occours near the da.fill()
When i run this query with hard coded values then it executes perfect in the SQL Server 2005.
If I change the query into :
cmd3.CommandText = "select Binnumber,date from [dbo].[Voltaix_BINCYL_Location] where Cylnumber =" & cb_cyl.SelectedValue
I get error:
Conversion failed when converting the varchar value 'fasf' to data type int.
If I change the query into:
cmd3.CommandText = "select Binnumber,date from [dbo].[Voltaix_BINCYL_Location] where Cylnumber = '& cb_cyl.SelectedValue.ToString'"
I get only the headers of the columns and no data when actually there is one.
|