does not have a corresponding column in the data reader with the same name

前端 未结 4 1232
清歌不尽
清歌不尽 2021-01-04 00:56

I have Table named tbl_search with columns : id(int), title(nvarchar100), result(ntext) and i want using SQL query, like

4条回答
  •  抹茶落季
    2021-01-04 01:13

    Your SQL Statement only returns the title not the full entity.

    Change:

    Select top 1 title From tbl_search Where title=@title and id=@id 
    

    to:

    Select top 1 * From tbl_search Where title=@title and id=@id 
    

提交回复
热议问题