level 7
string sql = "Select * from login";
string str = "Data Source=" + Application.StartupPath + @"/Xq1.db;Version=3";
SQLiteConnection conn = new SQLiteConnection(str);
SQLiteConnectionStringBuilder builder = new SQLiteConnectionStringBuilder();
builder.DataSource = str;
builder.Password = "a12315";
conn.ConnectionString = builder.ConnectionString;
//SQLiteCommand cmd = new SQLiteCommand(sql, conn);
SQLiteDataAdapter sdp = new SQLiteDataAdapter(sql,conn);
//sdp.SelectCommand = cmd;
DataSet ds = new DataSet();
sdp.Fill(ds, "login");
dataGridView1.DataSource = ds.Tables[0];
2014年09月14日 13点09分
2
level 14
知音,能有一个已经很好了,不必太多。如果实在没有,还有自己。好好对待自己,跟自己相处,也是一个朋友。
2014年09月14日 21点09分
4
大哥 能帮我一把不 我找了好多 都没有这一块的 我试了 好几种 都是失败告终的
2014年09月15日 01点09分
fill一共有五种用法,没有找到密码操作方面用法
2014年09月15日 02点09分
回复 小弘先生zhx : 我在上面声明了 密码了 楼下附上代码
2014年09月15日 02点09分
level 7
string str = @"D:\sqlite\SqlTestpro\SqlTest\bin\Debug\other.db";
SQLiteConnection conn = new SQLiteConnection();
SQLiteConnectionStringBuilder builer = new SQLiteConnectionStringBuilder();
builer.DataSource = str;
builer.Password = "a12315";
conn.ConnectionString = builer.ToString();
conn.Open();
SQLiteDataAdapter sdp = new SQLiteDataAdapter("select * from other",conn);
DataSet ds = new DataSet();
sdp.Fill(ds,"other");
dataGridView1.DataSource = ds.Tables[0];
conn.Close();
2014年09月15日 02点09分
5
level 14
勇敢,那是一个人年轻时唯一拥有的东西。在一次次的错误中成长,将所有看似错误的选择最终引导向正确的结果。我坚信,人应该有力量,揪着自己的头发把自己从泥地里拔起来。——廖一梅《像我这样笨拙地生活》
2014年09月15日 18点09分
7
level 1
连接的时候、password不赋值给builder,赋值给连接对象。
conn.SetPassword(“a12315“);
conn.Open();
你试试看吧
2014年09月19日 07点09分
10