如何在SQL Server 2014数据库中插入数学和化学方程式并使用C#将其检索为asp.net [英] how to insert mathematical and chemical equation in SQL server 2014 databse and to retrive it asp.net using c#

查看:269
本文介绍了如何在SQL Server 2014数据库中插入数学和化学方程式并使用C#将其检索为asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

am为数学,物理,化学等所有学科设计了一个在线测试系列项目.我在存储数学方程式时遇到问题,其中包括特殊符号和有机化学结构式等.我们如何将其存储在sql server 2014数据库中?

am designing a project for online test series for all subject like mathematics, physics, chemistry, . I have a problem in storing mathematical equation which includes special symbols an in organic chemistry structural formulas etc.How can we store it in sql server 2014 database

推荐答案

存储和检索这样的数据是一回事,呈现它是另一回事.如果要在浏览器中显示此类测试,则需要一种易于呈现的格式.您可能会想到以图像格式存储这些公式/等式/等.效果很好,但是将图像与其余内容相关联保留在关系数据库中是非常复杂的.
如果您不想在语义上进行编辑,则可以简单地将整个测试存储为XHTLM(在SQL Server数据库表中为nvarchar(max)).为什么,因为您有内嵌SVG [数据UI方案 [
Storing and retrieving such data is one thing, presenting it is an other. If you want to present such tests in a browser, you need a format that is easy to render. You might think of storing those formulas/equations/etc... in image format. Works great, but it is quite complicated to keep the images associated with the rest of the content in a relational database.
If you don''t want to edit them semantically, you can simply store the whole test as XHTLM (nvarchar(max) in the SQL Server database table). Why, because you have inline SVG[^], which is perfect for such things. You can simply author images with tools like InkScape, CorelDraw, or dedicated editors if you like, paste into the html code, and store the test with all that it needs. Still, inline SVG is not cross-browser (see table on the link above). If you need you can also use inline image (using data UI scheme[^]) in some cases (or both) - this is also not complerely supported by all browsers.
So your test will be self-contained in a single field of a single table row - if you can afford the supprt limitations of these methods.


SQL Server支持Unicode字符(请参见 http://unicode-table.com/en/#basic-latin [ nvarchar [
SQL Server supports Unicode characters (see http://unicode-table.com/en/#basic-latin[^]) so if you can express the formula in a way where those characters are sufficient, you can store the formula simply in a nvarchar[^] field


这篇关于如何在SQL Server 2014数据库中插入数学和化学方程式并使用C#将其检索为asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆