View Single Post
  #4 (permalink)  
Old 01-07-2009, 9:14 AM
shruti shruti is offline
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jan 2009
Posts: 4
Reputation: 0
shruti is on a distinguished programming path ahead
Default

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.
Reply With Quote