当前位置: 首页 > news >正文

网页建立网站平台如何做带后台的网站

网页建立网站平台,如何做带后台的网站,建筑工程网教育网,网站商务通登陆不上微软官网资料链接#xff08;可下载文档#xff09; 教程参考链接#xff1a;SQLite 教程 - SQLite中文手册 项目中对应的system.dat文件可以用SQLiteStudio打开查看 参考文档#xff1a;https://d7ehk.jb51.net/202008/books/SQLite_jb51.rar 总结介绍 1、下载SQLiteS…微软官网资料链接可下载文档 教程参考链接SQLite 教程 - SQLite中文手册 项目中对应的system.dat文件可以用SQLiteStudio打开查看 参考文档https://d7ehk.jb51.net/202008/books/SQLite_jb51.rar 总结介绍 1、下载SQLiteStudio对数据库文件进行管理、查看 2、代码中通过NuGet添加System.Data.SQLite 3、代码类SQLiteConnection连接本地数据库文件》SQLiteCommand配置命令并执行》连接关闭 一、SQLite数据下载安装使用管理查看数据 1下载 下载绿色免安装版本 链接百度网盘 请输入提取码 提取码hgoc 1、参考网站SQLite Home Page下载地址System.Data.SQLite: Downloads Page 2安装 免安装双击SQLiteStudio可以打开使用如果放在项目中建议复制到C:\Program Files (x86) 防止被误删除掉 3添加数据库 数据库》添加数据库》输入数据名称》确定 4创建数据表 Tables》新建表 自动生成的创建表的sql语句 1 2 3 4 5 6 7 8 CREATE TABLE SysAdmin (      LoginID   INTEGER      PRIMARY KEY AUTOINCREMENT                             DEFAULT (10000),      LoginName VARCHAR (20) NOT NULL,      LoginPwd  VARCHAR (50) NOT NULL,      Role      INTEGER      DEFAULT (0)                             NOT NULL ); 5添加字段 6数据库的位置 数据表都创建好了之后鼠标放在数据库名上就显示数据库所在的目录 二、C#使用SQLite数据需要添加的引用上面的wiki路径下载里有 1VS使用NuGet添加使用搜索System.Data.SQLite添加即可 三、代码中数据库命令操作 包含功能增删数据库文件增删改数据表增删改查数据内容 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SQLite; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using static System.Windows.Forms.VisualStyles.VisualStyleElement;namespace MyFrom {public partial class Form1 : Form{public Form1(){InitializeComponent();}// 添加数据表private void button1_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);//cn.Open();cn.Close();label1.Text 添加数据库完成;}// 删除数据表private void button2_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;if (System.IO.File.Exists(path)){System.IO.File.Delete(path);}label1.Text 删除数据库完成;}// 添加数据表private void button3_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;// cmd.CommandText CREATE TABLE t1(time stringid varchar(4),score int);cmd.CommandText CREATE TABLE IF NOT EXISTS t1(time string,id varchar(4),score int);cmd.ExecuteNonQuery();}cn.Close();label1.Text 添加数据表完成;}// 删除数据表private void button4_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;cmd.CommandText DROP TABLE IF EXISTS t1;cmd.ExecuteNonQuery();}cn.Close();label1.Text 删除数据表完成;}// 更改数据表名private void button5_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;cmd.CommandText ALTER TABLE t3 RENAME TO t1;cmd.ExecuteNonQuery();}cn.Close();label1.Text 更改表名完成;}// 添加数据表列元素private void button6_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;cmd.CommandText ALTER TABLE t1 ADD COLUMN age int;cmd.ExecuteNonQuery();}cn.Close();label1.Text 添加列完成;}// 添加数据private void button7_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;//time string,id varchar(4),score intcmd.CommandText INSERT INTO t1(time,id,score) VALUES(time,id,score);cmd.Parameters.Add(id, DbType.String).Value 666;//cmd.Parameters.Add(age, DbType.Int32).Value n;cmd.Parameters.Add(score, DbType.Int32).Value 22;cmd.Parameters.Add(time, DbType.String).Value DateTime.Now.ToString();cmd.ExecuteNonQuery();}cn.Close();label1.Text 添加数据完成;}// 更改数据private void button8_Click(object sender, EventArgs e){string s 888;int n 1077777;int myscore 1;string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;//time string,id varchar(4),score intcmd.CommandText UPDATE t1 SET idid,ageage WHERE id666;cmd.Parameters.Add(id, DbType.String).Value s;cmd.Parameters.Add(age, DbType.Int32).Value n;cmd.ExecuteNonQuery();}cn.Close();label1.Text 更改数据完成;}// 删除数据private void button9_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;//time string,id varchar(4),score intcmd.CommandText DELETE FROM t1 WHERE id888;cmd.ExecuteNonQuery();}cn.Close();label1.Text 删除数据完成;}// 查询数据private void button10_Click(object sender, EventArgs e){string path Application.StartupPath \\test.db;SQLiteConnection cn new SQLiteConnection(data source path);if (cn.State ! System.Data.ConnectionState.Open){cn.Open();SQLiteCommand cmd new SQLiteCommand();cmd.Connection cn;//time string,id varchar(4),score intcmd.CommandText SELECT * FROM t1 WHERE rowid2; // 读取第二行行数从1开始SQLiteDataReader sr cmd.ExecuteReader();Console.WriteLine(查询到的数据如下);while (sr.Read()){int count sr.VisibleFieldCount;for (int i 0; i count; i){Console.WriteLine(sr[i].ToString() );}string s sr.GetString(0);Console.WriteLine(s);}sr.Close();}cn.Close();label1.Text 查询数据完成;}} }
http://www.w-s-a.com/news/342768/

相关文章:

  • 个人网站怎么自己备案重庆怎样网站推广
  • 做电影网站挣钱吗重庆网站建设技术托管
  • 网站建设用户登录网站商业授权含义
  • 接做室内效果图的网站wordpress制作上传图片
  • 维护一个网站一年多少钱网站微信登录怎么做的
  • 中国建设银行网站E路护航官网如何在招聘网站上选个好公司做销售
  • 网站开发质量管理招聘网站建设方案
  • 有没有那个的网站seo编辑的工作内容
  • 平度那里有做网站的昆明建设招聘信息网站
  • 邯郸城乡建设部网站首页唐山市住房城乡建设部网站主页
  • 慕课联盟网站开发实战六安品牌网站建设电话
  • 制作企业网站首页贵州小程序制作开发
  • 什么是网站后台郑州众志seo
  • 做线上交互的网站分销平台
  • 培训机构网站开发江门cms模板建站
  • 网站描述模板建筑模型网站有哪些
  • 域名注册费用张家界seo
  • 淘宝联盟怎么自己做网站山西省住房与城乡建设厅网站
  • 最新网站建设常见问题使用微信推广的各种方法
  • 购物网站建设课程设计报告做木工的网站
  • 扶沟县网站开发网站建设在哪里进行
  • 查看网站服务器信息网站首页地址 网站域名
  • 网站网站制作网站的ui界面设计案例分析
  • 怎么查网站是否备案成都装修公司联系电话
  • 佛山免费发布信息的网站oa办公系统排行榜
  • 南湖区建设街道办事处网站汕头建设银行各支行电话
  • 复古风格网站网站套餐方案
  • 界面设计做的好的网站旅游商城网站模板
  • 大型电子商务网站 服务器硬件 cpu 内存 硬盘 2014美食网站开发意义
  • 建立网站的目的和意义网站建设寻求