SQLite报 no such table

seener_wal 2012-03-30 11:45:11
//将信息插入数据库
private void insertInfo(ArrayList insertList)
{
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + "card.db");
SQLiteCommand cmd = new SQLiteCommand("insert into CARD_INFO (SFZH,XM,XB,MZ,CSRQ,ZZXZ) VALUES (" + insertList + " )", scn);
scn.Open();
cmd.ExecuteNonQuery();
scn.Close();
}
C#这方面不是很熟悉希望大家帮帮
...全文
1026 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
kkgoose 2012-03-30
  • 打赏
  • 举报
回复
路径有问题
SQLiteConnection scn = new SQLiteConnection("Data Source =E:\\c#_workspace\\mp\\mp\\db\\card.db");
seener_wal 2012-03-30
  • 打赏
  • 举报
回复
private void insertInfo(string gmsfzh,string xm,string xb,string mz,string csrq,string zzxz)
{
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + "E:\\c#_workspace\\mp\\mp\\db\\card.db");
SQLiteCommand cmd = new SQLiteCommand("insert into CARD_INFO (SFZH,XM,XB,MZ,CSRQ,ZZXZ) VALUES ('" + gmsfzh + "','" + xm + "','" + xb + "','" + mz + "','" + csrq + "','" + zzxz + "')", scn);
scn.Open();
cmd.ExecuteNonQuery();
scn.Close();
}
我这个就是做了个刷身份证的然后把刷证件的信息存入到本地数据库
现在改了绝路径说不支持格式
seener_wal 2012-03-30
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]
引用 4 楼 的回复:

引用 3 楼 的回复:
引用楼主 的回复:
//将信息插入数据库
private void insertInfo(ArrayList insertList)
{
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirector……
[/Quote]
private void insertInfo(string gmsfzh,string xm,string xb,string mz,string csrq,string zzxz)
{
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + "E:\\c#_workspace\\mp\\mp\\db\\card.db");
SQLiteCommand cmd = new SQLiteCommand("insert into CARD_INFO (SFZH,XM,XB,MZ,CSRQ,ZZXZ) VALUES ('" + gmsfzh + "','" + xm + "','" + xb + "','" + mz + "','" + csrq + "','" + zzxz + "')", scn);
scn.Open();
cmd.ExecuteNonQuery();
scn.Close();
}
我已经改了
EnForGrass 2012-03-30
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

引用 3 楼 的回复:
引用楼主 的回复:
//将信息插入数据库
private void insertInfo(ArrayList insertList)
{
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + "card.d…………
[/Quote]
把你改的代码贴上来,传ArrayList肯定不行
seener_wal 2012-03-30
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
数据库里有这个表吗?CARD_INFO

no such table就是表名错误的提示
[/Quote]

这个表有的
seener_wal 2012-03-30
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]
引用楼主 的回复:
//将信息插入数据库
private void insertInfo(ArrayList insertList)
{
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + "card.d……

是的,没这个表,插入一……
[/Quote]
是路径不对我直接写死了 ,但是又出现不支持给定的路径格式 ,那个list已经改了
EnForGrass 2012-03-30
  • 打赏
  • 举报
回复
[Quote=引用楼主 的回复:]
//将信息插入数据库
private void insertInfo(ArrayList insertList)
{
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + "card.d……
[/Quote]
是的,没这个表,插入一个ArrayList insertList这样写能行吗?
gxingmin 2012-03-30
  • 打赏
  • 举报
回复
数据库里有这个表吗?CARD_INFO

no such table就是表名错误的提示
孟子E章 2012-03-30
  • 打赏
  • 举报
回复
没有CARD_INFO这个表
kkgoose 2012-03-30
  • 打赏
  • 举报
回复
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + "card.db");
seener_wal 2012-03-30
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 的回复:]
路径有问题
SQLiteConnection scn = new SQLiteConnection("Data Source =E:\\c#_workspace\\mp\\mp\\db\\card.db");
[/Quote]
SQLiteConnection scn = new SQLiteConnection("Data Source = " + AppDomain.CurrentDomain.BaseDirectory + @"~/card.db");
这样也不对

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧