如何为1000个成员创建表? [英] How to create tables for 1000 members?

查看:53
本文介绍了如何为1000个成员创建表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有两个或三个用户,则可以为注册页面创建表格

但如果有1000个成员..可以为每个用户或一个表创建表格所有并告诉我如何检索

plz帮助我

if there are two or three users,it was able to create tables for registration page
but if there are 1000 members..is it possible to create table for every single user or one table for all and tell me how it can retrieve
plz help me

推荐答案

为所有用户创建一个表,你需要有办法通过具有唯一字段来识别每个用户。例如,用户名字段可以用作表的唯一列。当用户注册时,您可以检查现有数据中是否已经给出了给定的用户名。

当您需要获取可以使用用户名列查询的用户详细信息时,例如

create one table for all the users, you need to have way to identity each user by having unique field. for example user name field can be used as unique column for your table. when user register you can check whether given user name is already given or not from your existing data.
when you need to get user details you can query using the user name column, for example
select * from Userdetail where username ='user1' 


上面的
只会给出user1的详细信息,即使你有1000或者你桌子上的用户。这些是SQL和ASP.NET的基础知识,您最好阅读有关此主题的书籍/文章/教程。

任何方式ASP.NET都可以提供更安全,更易于配置的成员资格机制。请阅读下面的CP教程

ASP.NET成员资格和角色提供者 [ ^ ]


除了上述解决方案之外,您还必须学习数据库设计,以便真正了解数据库的设计和工作方式,从数据库设计简介 [ ^ ]
Apart from the above solutions, you have to learn database design in order to really understand how databases are designed and work, start from Introduction to database design[^]


你要做的就是创建一个表说USER并将每个用户注册详细信息存储在其中。此表必须包含UserID作为其主键。



之后创建另一个表,让我们说USER_DETAILS。该表必须包含表USER的主键UserID作为其外键。在USER_DETAILS表中插入用户详细信息。并使用其外键检索所有详细信息。



从USER_DETAILS中选择*,其中UserID = UserId
What you have to do is to create a single table say "USER" and store each and every user registration detail in it. This table must contain UserID as its primary key.

After that create another table lets say "USER_DETAILS". This table must contain primary key "UserID" of table "USER" as its foreign key. Insert user details in "USER_DETAILS" table. and Retrieve all details with its foreign key.

select * from USER_DETAILS where UserID = UserId


这篇关于如何为1000个成员创建表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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