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

电子商务网站建设管理答案第一活动线报网

电子商务网站建设管理答案,第一活动线报网,页面优化的方法有哪些,如何做好网络维护工作1#xff0c;一般的访问方式。 1.1#xff0c;连接语句。 //sqlite 连接,支持相对位置#xff0c;也支持绝对位置 Data Source../../Database/cater.db// 连接数据库#xff0c;FailIfMissingfalse时若文件不存在会自动创建 string connStr DataSourcetest.db;Vers…1一般的访问方式。 1.1连接语句。 //sqlite 连接,支持相对位置也支持绝对位置 Data Source../../Database/cater.db// 连接数据库FailIfMissingfalse时若文件不存在会自动创建 string connStr DataSourcetest.db;Version3;Poolingtrue;FailIfMissingfalse;; 1.2配置文件设置。 //需在配置文件中进行如下配置否则报错 startup useLegacyV2RuntimeActivationPolicytrue supportedRuntime versionv4.0 sku.NETFramework,Versionv4.5.2 / /startup1.3常用语法。 //语法 select * from AlarmHistory insert into alarmhistory (AlarmDetails,starttime) values (abcgetdate()) //获取当前时间 select datetime(now) SELECT datetime(now, localtime); select CURRENT_TIMESTAMP//插入当前时间 insert into alarmhistory (alarmdetails,starttime) values(,datetime(now,localtime))//查找为null的数据 select * from alarmhistory where StartTime is null//修改表格序号update sqlite_sequence set seq 0 where name AlarmHistory//查询表格主键 select * from pragma_table_info (ActualData) where pk1//查询表格是否存在 select exists( select * from sqlite_master where typetable and nameActualData)//删除表格drop table ActualData //获取和设置时间时间格式只支持类似yyyy-MM-dd这样用-连接的格式若用/连接则无效 select datetime(2024-08-22 16:23:55) SELECT datetime(now, localtime); 1.4SQLite访问dll。 https://download.csdn.net/download/lingxiao16888/89914696 2基于EntityFramework的ORM数据访问。 2.1安装Nuget包 这部分比较简单直接Nuget包中下载即可 System.Data.SQLiteSystem.Data.SQLite.EF6System.Data.SQLite.LINQSQLite.CodeFirst 2.2配置文件需要进行如下修改。 ?xml version1.0 encodingutf-8? configurationconfigSections!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID237468 --section nameentityFramework typeSystem.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version6.0.0.0, Cultureneutral, PublicKeyTokenb77a5c561934e089 requirePermissionfalse //configSectionsstartupsupportedRuntime versionv4.0 sku.NETFramework,Versionv4.5.2 //startupentityFrameworkprovidersprovider invariantNameSystem.Data.SqlClient typeSystem.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer /provider invariantNameSystem.Data.SQLite typeSystem.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6 /provider invariantNameSystem.Data.SQLite.EF6 typeSystem.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6 //providers/entityFrameworksystem.dataDbProviderFactoriesremove invariantSystem.Data.SQLite.EF6 /add nameSQLite Data Provider (Entity Framework 6) invariantSystem.Data.SQLite.EF6 description.NET Framework Data Provider for SQLite (Entity Framework 6) typeSystem.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6 /remove invariantSystem.Data.SQLite /add nameSQLite Data Provider invariantSystem.Data.SQLite description.NET Framework Data Provider for SQLite typeSystem.Data.SQLite.SQLiteFactory, System.Data.SQLite //DbProviderFactories/system.data /configuration 2.3应用。 using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity; using System.Data.SQLite; using System.Linq; using System.Text; using System.Threading.Tasks;namespace ConsoleApp2 {class Program{static void Main(string[] args){MyDbContext context new MyDbContext(cater.db);var set context.SetMemmberType();var ss set.FirstOrDefault();foreach (var item in set){Console.WriteLine(${item.MemTpName} ; {item.MemType} ; {item.MemTpDesc} ; {item.SubBy} ;{item.DelFlag});}Console.WriteLine(输出完成);Console.ReadKey();}}class MyDbContext : DbContext{public MyDbContext(string constr) : base(new SQLiteConnection{ConnectionString new SQLiteConnectionStringBuilder{DataSource constr,ForeignKeys true}.ConnectionString}, true){}//如果查询 MemmberType 表则该属性不能省略public virtual DbSetMemmberType MemmberType { get; set; }}[Table(MemmberType)]//该特性不能省略class MemmberType{[Key]//如果存在主键该特性不能省略[Column(MemType,TypeName INT)]public int MemType { get; set; }//[Column(MemTpName)]public string MemTpName { get; set; }[Column(MemTpDesc)]//可使用 Required 特性指定该列不能为空public string MemTpDesc { get; set; }//[Column(DelFlag)]public int DelFlag { get; set; }//[Column(SubBy)]public int SubBy { get; set; }} } 2.4效果。 数据库文件数据。 查询结果。
http://www.w-s-a.com/news/32186/

相关文章:

  • 网站建立时间查询做百度移动网站优化排
  • 网站建设和运行费用qq恢复官方网站
  • 可以免费建立网站吗免费的网络营销方式
  • 天津企业设计网站建设wordpress标题字体大小
  • 上高县城乡规划建设局网站创业项目
  • 钓鱼网站在线下载广州网站设计哪里好
  • 做阿里国际网站会有成效吗wordpress微博同步
  • 西安网站建设云速网络网站运营情况怎么写
  • 免费建网站的网站微信商城分销系统方案
  • 烟台网站seo服务友情链接有哪些展现形式
  • 什么是移动网站开发免费网站开发框架
  • 做网站 创业wordpress子菜单
  • 门户网站类型有哪些权重7以上的网站
  • 政务网站建设论文android app开发教程
  • 网站开发实训h5总结个人网站注册平台要多少钱
  • 空白网站建设wordpress高亮代码过长
  • 盐城 网站开发什么叫做门户网站
  • 广东快速做网站公司哪家好本地建wordpress
  • dedecms如何做网站贵阳seo计费管理
  • 企业网站设计一般多少钱呼和浩特最好的互联网公司
  • 黄浦专业做网站海南网站策划
  • 网站开发工程师有证书考试吗织梦cms是免费的吗
  • 电子商务网站建设需要学什么门户网站推广介绍方案
  • 网站里的专题页面wordpress查询数据库结构
  • WordPress子站站群网站建设代码生成器
  • 怎么攻击织梦网站甘肃省最新消息今天
  • 赣州哪里可以做网站看装修案例的网站
  • 旅游网站专业化建设的要点php 手机网站 模板
  • wordpress百度站长主动推送长春火车站官网
  • 比较好的响应式网站wordpress博客增加音乐页面