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

前端 未结 3 625
逝去的感伤
逝去的感伤 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:45

    Remove the square brackets around the field names in your Bind statements, eg

         
    

    The brackets are really necessary only in the query portion of the UpdateCommand to allow for the presence of spaces in the field names. The brackets can cause all kinds of strange confusion in the background code ASP.NET generates when building the page. Hope that helps.

提交回复
热议问题