插入方法到Sql Server 2008的60个文本框..

编程入门 行业动态 更新时间:2024-10-26 22:18:51
本文介绍了插入方法到Sql Server 2008的60个文本框..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的应用程序中,我有一个网页,我必须回答近60个总和。每个总和都有一个文本框(比如txtSum1,txtSum2 ....)来回答。我必须将这些总和答案插入数据库。通常我是怎么做的(10个总和)我在一个表中创建了10列,并将其命名为sum1,sum2,sum3 .... ...并将sum1的答案插入sum1列,所以...但是对于60个总和它不是一个好方法.. plz告诉我如何将这60个sums值插入数据库(只需告诉我我需要什么colunms。我应该创建60列或任何其他方法)。

In my application i have a web page where i have to answer nearly 60 sums. Each sum have a textbox(say txtSum1,txtSum2....) to answer. I have to insert these sums answer to Database. Normally how i do is (for 10 sums) i created 10 columns in a table and names as sum1,sum2,sum3.... ...and insert the sum1 answer to sum1 column and so...But for 60 sums it is not a good method.. plz tell me how to insert these 60 sums value to database(just tell me what are the colunms i needed. Should i create 60 columns or any other method).

推荐答案

这取决于你以后想要用它们做什么。 因为总有60个文本框,(虽然那个'''很多用户可以一次性应对,我会考虑将它们减少到六页十分左右)如果我需要做任何算术,我可能会选择连续60列的方法以后计算它们的值。如果我只是保留它们作为参考,那么我可能会使用一个列,并将答案连接成一个CSV值。 唯一的其他方法是有一个完整的单独的表,每个文本框有一行,每行有一个ID链接回原始页面行和一些文本框号的指示。讨厌,浪费。 It really depends on what you want to do with them later. Since there are always 60 text boxes, (although that''s a lot for a user to cope with in one go, I''d consider cutting them down to six pages of ten or so) I would probably go with the "60 columns in a row" approach, if I needed to do any arithmetic ot calculation on they values later. If I was just keeping them for reference, then I would probably use a single column, and concatenate the answers together into a single CSV value. The only other approach is to have a whole separate table with a row per text box, each row having a ID linkiing it back to the original page row and some indication of the textbox number. Nasty, and wasteful.

更多推荐

插入方法到Sql Server 2008的60个文本框..

本文发布于:2023-10-25 03:17:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1525764.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本框   方法   Sql   Server

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!