Simple SQL select in C#?

后端 未结 5 735
春和景丽
春和景丽 2020-12-09 11:28

On my current project, to get a single value (select column from table where id=val), the previous programmer goes through using a datarow, datatable and an sqldatadapter (a

5条回答
  •  难免孤独
    2020-12-09 12:04

    you can use SqlCommands executeScalar function. Please look at the following link

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executescalar.aspx

提交回复
热议问题