SQLite中使用C#添加参数 [英] Adding parameters in SQLite with C#

查看:489
本文介绍了SQLite中使用C#添加参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是学习SQLite和我不能让我的参数编译成的指挥得当。当我执行以下code:

Im just learning SQLite and I can't get my parameters to compile into the command properly. When I execute the following code:

this.command.CommandText = "INSERT INTO [StringData] VALUE (?,?)";

this.data = new SQLiteParameter();
this.byteIndex = new SQLiteParameter();

this.command.Parameters.Add(this.data);
this.command.Parameters.Add(this.byteIndex);

this.data.Value = data.Data;
this.byteIndex.Value = data.ByteIndex;

this.command.ExecuteNonQuery();

我得到一个SQLite异常。经检查CommandText中我发现,无论我在做不正确添加参数: INSERT INTO [StringData是]值

任何想法,我缺少的是什么?

Any ideas what I'm missing?

感谢

推荐答案

的尝试而不是

这篇关于SQLite中使用C#添加参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆