当前位置:网站首页>ASP.NET项目开发实战入门_项目六_错误报告(自己写项目时的疑难问题总结)
ASP.NET项目开发实战入门_项目六_错误报告(自己写项目时的疑难问题总结)
2022-06-12 08:00:00 【TwoCM】
1:项目说明和课设要求
员工界面:
管理员界面:



2:对于js代码的相关错误测试:
无法在源文件设断点Debug,
可以在浏览器里进行设置断点然后进行检测相关数据变化来检查

3:可视化部分错误:
3.1: echarts文件引入运行报错
引入echarts进行操作步骤
1:引入echarts的js文件
2: 创建显示可视化图片的容器
3:编写相关功能代码
原因是没有在第一步成功导入echarts文件
经过分析: 是因为把对应的script代码写在了展示容器(div)的上面,只要实现可视化功能的script代码写在div下面即可
3.2: echarts饼状图展示的数据格式是 value-name
因为饼状图展示的数据格式是 value-name ,所以存入数据时也需要按照此种格式存储 voteT_Q.push({ value: voteQty[i], name: voteTitle[i] });
3.3: 查询数据表相关数据的sql语句错误使得获取的数据转化为json数据出错
查询vote相关数据的sql语句
//string sql ="select * from vote "; error 经过测试是voteContent属性的数据存储转换为json有错误
string sql = “select voteTitle,SUM(voteQty) as num from vote GROUP BY voteTitle order by num desc”; //正确的sql语句
一开始使用的是错误的sql语句,因为我想把voteContent里的数据也展示到饼状图里,但是运行发现饼状图不显示,也没有任何的报错信息,因为单独运行获取vote数据表数据的函数,能获取到结果,所以一开始并没有发现是后台的错误,以为是前端饼状图的设置不对,后来经过一步步排查,数据的json转换测试等发现是sql语句的错误,然后发现voteContent里的数据转换json格式失败,所以最后改成了正确的sql语句
3.4: 注意前端获取数据时,对应的json格式属性名可能与数据表的属性名不同
获取投票数目的代码:
//voteQty[i] = item.voteQty; //投票数 错误
voteQty[i] = item.num; //投票数目 正确
tip: 修改完上述3.3的error之后,饼状图只能展示图标信息,具体信息没展示出来,然后最开始排查知道大概是数据方面的错误,然后一步步查看对比发现是由于前端获取的数值数据转换成了num属性名称.
虽然数据表里面表示票数的属性是voteQty,但是在前端获取数据时,对应的json格式属性名是num,即数据表里面voteQty的数据都存储在了dataobj.root的num属性里,所以获取票数用item.num
3.5: 框架版本太低,需要升级
框架版本太低,需要升级
数据转化为json时用到了之前的f.cs类代码,需要使用引用
using System.Web.Script.Serialization //序列化反序列化文件
但是写了此句之后会提示没有这个空间,最后发现是因为框架版本太低,需要升级
4.sql语句的相关注意事项
4.1 sql语句里插入数值数据直接输入具体数值是错误的,需要定义int类型的变量将数值存在变量里,再利用变量插入数据.

4.2: sql语句插入日期相关内容,特殊符号的转换


最开始写的sql语句只有like % xx % , 但是发现有错误,查询数据库数据返回的结果为null,后来经过查找发现是特殊符号的转化问题,然后尝试了几种方法的转义,e,g: 加方括号[]进行转义,或者利用escade进行转义等方法都不行,后来最后发现了convert方法可以.
navicat15 创建数据表时主键自增设置


边栏推荐
- Vision Transformer | Arxiv 2205 - LiTv2: Fast Vision Transformers with HiLo Attention
- C # push box
- R language dplyr package mutate_ At function and one_ The of function converts the data type of a specified data column (specified by a vector) in dataframe data to a factor type
- Compiling principle on computer -- functional drawing language (I)
- Search and rescue strategy of underwater robot (FISH)
- S-msckf/msckf-vio technical route and code details online blog summary
- [redistemplate method details]
- Vins technical route and code explanation
- [RedisTemplate方法详解]
- OpenMP task 原理與實例
猜你喜欢

Vision Transformer | Arxiv 2205 - LiTv2: Fast Vision Transformers with HiLo Attention

Literature reading: raise a child in large language model: rewards effective and generalizable fine tuning

Servlet advanced

2021.11.3-7 scientific research log

Vscode的Katex问题:ParseError: KaTeX Parse Error: Can‘t Use Function ‘$‘ In Math Mode At Position ...

Fundamentals of Mathematics - Taylor Theorem

Vision transformer | arXiv 2205 - TRT vit vision transformer for tensorrt

Topic 1 Single_ Cell_ analysis(4)

Literature reading: deep neural networks for YouTube recommendations

Pytorch profiler with tensorboard.
随机推荐
Improvement of hash function based on life game (continued 2)
N-order nonzero matrix AB, matrix ab=0, then the rank of a and B is less than n
StrVec类 移动拷贝
Leetcode notes: biweekly contest 69
Topic 1 Single_Cell_analysis(1)
Vscode 1.68 changes and concerns (sorting and importing statements / experimental new command center, etc.)
The R language uses the sample The split function divides the machine learning data set into training set and test set
Ten important properties of determinant
2D visualization of oil storage, transportation and production, configuration application enables intelligent development of industry
Improvement of hash function based on life game
MinGW offline installation package (free, fool)
Leetcode notes: Weekly contest 278
20220525 RCNN--->Faster RCNN
Upgrade eigen to version 3.3.5 under Ubuntu 16.04
ECMAScript6面试题
Solve the problem of uploading sftporg apache. commons. net. MalformedServerReplyException: Could not parse respon
20220524 backbone deep learning network framework
Final review of Discrete Mathematics (predicate logic, set, relation, function, graph, Euler graph and Hamiltonian graph)
JSP technology
Cookies and sessions





