Codsmith软件下载页面:http://www.ibeifeng.com/down.php?id=36606
CodeSmith开发系列资料总结 http://terrylee.cnblogs.com/archive/2005/12/28/306254.aspx
sqlite驱动下载页面:http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
Navicat for sqlite管理工具下载页面:http://www.pc6.com/softview/SoftView_57268.html
下载三个驱动文件:
http://system.data.sqlite.org/downloads/1.0.82.0/sqlite-netFx40-setup-bundle-x86-2010-1.0.82.0.exe
实际上只要装此集合包就行了,装之前关闭VS2010 , 之后打开服务器资源管理器 -> 添加连接
http://system.data.sqlite.org/downloads/1.0.82.0/sqlite-netFx40-setup-x86-2010-1.0.82.0.exe
http://sourceforge.net/projects/sqlite-dotnet2/files/SQLite%20for%20ADO.NET%202.0/(选择最新版本的sqlite-1.0.66.0-setup.exe下载)
下载: SQLite-1.0.66.0-setup.exe
C开发环境中 ,需要下载sqlite源码包,其中引入sqlite3.c、sqlite.h即可
下载: sqlite-amalgamation-3071400.zip
//创建一个数据库文件
//string datasource = "d:/test.db";
//System.Data.sqlite.sqliteConnection.Createfile(datasource);
//连接数据库
sqliteConnection conn = new sqliteConnection();
sqliteConnectionStringBuilder connstr = new sqliteConnectionStringBuilder();
connstr.DataSource = "E:/test/test.db";
//connstr.Password = "admin";//设置密码,sqlite ADO.NET实现了数据库密码保护
conn.ConnectionString = connstr.ToString();
conn.open();
//创建表
//sqliteCommand cmd = new sqliteCommand();
//string sql = "CREATE table test(username varchar(20),password varchar(20))";
//cmd.CommandText = sql;
//cmd.Connection = conn;
//cmd.ExecuteNonquery();
//插入数据
sqliteCommand cmd = new sqliteCommand();
string sql = "INSERT INTO userinfo VALUES(10,'lcd','123456')";
cmd.CommandText = sql;
cmd.Connection = conn;
cmd.ExecuteNonquery();
//取出数据
sql = "SELECT * FROM userinfo";
//select c.rowID from userinfo可以获取到数据库行ID cmd.CommandText = sql; sqliteDataReader reader = cmd.ExecuteReader(); String username = ""; String password = ""; while (reader.Read()) { username = reader.GetString(1); password = reader.GetString(2); } MessageBox.Show(username + ";" + password);
总结以上是内存溢出为你收集整理的CodeSmith+SQLite+VS2010开发环境搭配全部内容,希望文章能够帮你解决CodeSmith+SQLite+VS2010开发环境搭配所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)