开发者

Appropriate C# command for ADO.NET SQlite when implementing COUNT() query

开发者 https://www.devze.com 2022-12-27 07:33 出处:网络
Consider this command, as written here: Command.CommandText = \"SELECT COUNT(ASSET) AS POSEXISTS FROM POSITIONS WHERE ASSET = @ASSET\";

Consider this command, as written here:

Command.CommandText = "SELECT COUNT(ASSET) AS POSEXISTS FROM POSITIONS WHERE ASSET = @ASSET";
        Command.Parameters.Add("@ASSET",DbType.String).开发者_Python百科Value = Symbol;

So here, how should I execute this query so that, I can receive the POSEXISTS variable in the C# environment.

Soham


int posExists = (int)Command.ExecuteScalar();
0

精彩评论

暂无评论...
验证码 换一张
取 消