The above error can result if you bound SQLDataSource to Formview ( or Gridivew – did not try GridView myself) where you are reusing a declare variable. For example you want to insert startDate and EndDate and all want to enter the difference of the two, you would so the following in SQL
Insert into mytable (startDate,EndDate,TotalDays)
You will get the above error because you are using @StartDate twice in the query. Also you are using @EndDateTwice in the query. To temporarily resolve the error, simply use an integer number in place of DateDiff function and the query will work.