Incorrect syntax near 'nvarchar' must declare scalar variable near @num

前端 未结 3 574
逝去的感伤
逝去的感伤 2021-01-28 06:36

Hi all I created a project that has a Formview bound to a Gridview. All the other commands seem to work fine except when I try to update the form view I get the error in the tit

3条回答
  •  心在旅途
    2021-01-28 06:55

    Here's an excerpt from this reference:

    Check the SqlDataSource object for any fields you’ve pulled or renamed with spaces in them. An ‘_’ Underscore will work fine, but doing a query like this "Select [somename] as [Some Name] FROM [names] WHERE [id]=@id" will result in the above error

    Try replacing all the spaces with underscores (e.g. Job_Title)

提交回复
热议问题