不确定如何描述这个问题...... [英] not sure how to describe this question...

查看:64
本文介绍了不确定如何描述这个问题......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在asp .net和vb .net中编写应用程序。我的问题

只是验证我需要参加一个正式的编程课程而不是

这个即时学习东西:)


这是'情况。我有一个网站,人们可以从

访问不同的网站代码(网站代码=建筑ID)。每个用户都有一个

配置文件,以及基于配置文件的系统权限。用户

目前只能对他/她所居住的网站数据库进行更改。我希望能够添加

使用户负责多个站点的能力。那么,就目前而言,我有一个带有site_code列的sql数据库,该列保存了用户的

站点的ID。


我遇到的问题是如何为用户管理多个站点代码

当我不知道他/她是否要负责1,2,3,4,或者更多

网站。这对我来说是有意义的,我很感激

的任何输入。


我应该能够存储用户的一个或多个站点代码在一个数据库列中具有

访问权限。也许用空格或逗号分隔

或者我不知道。


当我加载这些网站代码时,我应该使用某种数组还是

集合?现在我们进入asp .net部分。我需要在会话中存储

这些信息,以便跨页面提供。 Eitehr

的方式,当我进入一个我需要查看网站代码的例行程序时,用户有权使用,我应该可以这样做:


对于每个site_code中的< something>

''检查网站代码的任何内容并确定应该是什么

done

下一页


我有意义吗?我对这种事情缺乏经验。

谢谢你!

Hi all,

I''m writing an application in asp .net and vb .net. The question I have
just verifies I need to take an official programming course instead of
this "learning on the fly" stuff :)

Here''s the situation. I have a site that people will access from
different site codes (site code = building ID). Each user will have a
profile, and permissions to the system based on the profile. The user
currently can only makes changes to the database for the site
code(building) he/she resides in. I''d like to be able to add the
ability to make a user responsible for several sites. So, for now, I
have an sql database with a site_code column that holds the id of the
site for the user.

The issue I am having is how to manage multiple site codes for a user
when I don''t know if he/she will be responsible for 1,2,3,4, or more
sites. Here is what makes sense to me, and I appreciate any input on
this.

I should be able to store the one or more site codes the user has
access to in one database column. Maybe delimited by spaces or commas
or I don''t know.

When I load these site codes, should I use some kind of array or
collection? Now we are getting into the asp .net part. I need to store
this information in session so it is available across pages. Eitehr
way, when I get to a routine where I need to check the site codes a
user has permission to, I should be able to do something like:

For each site_code in <something>
''check whatever against the site code and determine what should be
done
Next

Am I making any sense? I am inexperienced with this kind of thing.
Thank you!

推荐答案

为什么不拥有一张桌子具有ResponsiblePerson列的站点?


SiteCode | ResponsiblePerson

------------ | ----------------------

NYNYC |史蒂文

NYLNG |史蒂文


然后只需做一个SELECT来抓住它们:


SELECT SiteCode FROM Sites WHERE ResponsiblePerson =''Steven''


您建议的方式可行,但您需要拆分站点代码

using类似的东西...


dim Sites()as string

Sites = SiteCodes.Split(",")


现在你有一个字符串数组。


我的整数= 0到Sites.Length-1

SiteCode =网站(I)

''与SiteCode签约

下一页

< ma ******** @ gmail。 COM>在消息中写道

新闻:11 ********************* @ h76g2000cwa.googlegro ups.com ...
Why not have a table of sites with a ResponsiblePerson column?

SiteCode | ResponsiblePerson
------------|----------------------
NYNYC |Steven
NYLNG |Steven

Then just do a SELECT to grab them:

SELECT SiteCode FROM Sites WHERE ResponsiblePerson=''Steven''

The way you suggested would work, but you''d need to split the site codes
using something like so...

dim Sites() as string
Sites=SiteCodes.Split(",")

Now you''d have an array of strings.

For I as Integer=0 to Sites.Length-1
SiteCode=Sites(I)
''Do somethign with SiteCode
Next
<ma********@gmail.com> wrote in message
news:11*********************@h76g2000cwa.googlegro ups.com...
大家好,

我正在asp .net和vb .net中编写应用程序。我的问题只是验证我需要参加一个正式的编程课程,而不是这个即时学习课程。东西:)

这是情况。我有一个人们将从不同的站点代码访问的站点(站点代码=建筑物ID)。每个用户都有一个
配置文件,以及基于配置文件的系统权限。用户目前只能对他/她所在的网站代码(建筑物)进行数据库更改。我希望能够添加
能力来制作一个用户负责几个站点。所以,现在,我有一个带有site_code列的sql数据库,该列保存了用户的网站ID。

我遇到的问题是如何管理用户的多个站点代码
当我不知道他/她是否将负责1,2,3,4或更多
站点时。这对我来说是有意义的,我感谢您对此的任何意见。

我应该能够存储用户可以访问的一个或多个站点代码。一个数据库列。也许用空格或逗号分隔
或者我不知道。

当我加载这些网站代码时,我应该使用某种数组或
集合吗?现在我们进入asp .net部分。我需要在会话中存储这些信息,以便跨页面提供。 Eitehr
方式,当我进入我需要查看用户有权使用的网站代码的例行程序时,我应该可以执行以下操作:

site_code in< something>
''检查网站代码的内容并确定应该做什么


我有意义吗?我对这种事情缺乏经验。
谢谢!
Hi all,

I''m writing an application in asp .net and vb .net. The question I have
just verifies I need to take an official programming course instead of
this "learning on the fly" stuff :)

Here''s the situation. I have a site that people will access from
different site codes (site code = building ID). Each user will have a
profile, and permissions to the system based on the profile. The user
currently can only makes changes to the database for the site
code(building) he/she resides in. I''d like to be able to add the
ability to make a user responsible for several sites. So, for now, I
have an sql database with a site_code column that holds the id of the
site for the user.

The issue I am having is how to manage multiple site codes for a user
when I don''t know if he/she will be responsible for 1,2,3,4, or more
sites. Here is what makes sense to me, and I appreciate any input on
this.

I should be able to store the one or more site codes the user has
access to in one database column. Maybe delimited by spaces or commas
or I don''t know.

When I load these site codes, should I use some kind of array or
collection? Now we are getting into the asp .net part. I need to store
this information in session so it is available across pages. Eitehr
way, when I get to a routine where I need to check the site codes a
user has permission to, I should be able to do something like:

For each site_code in <something>
''check whatever against the site code and determine what should be
done
Next

Am I making any sense? I am inexperienced with this kind of thing.
Thank you!



我经常看到那些试图将逗号分隔数据放入
数据库字段。我经常建议不要这样做。


将信息放在一个单独的表中,就像Terry Olsen建议的那样建议使用
,只使用网站的ID和如果可能的话。


如果你将一个人的所有网站都放在一个字段中,那么该字段对于数据库操作来说就更无用了。例如,如果您想要列出所有负责不同网站的人员,那么您必须编写很多代码来查找信息。如果您将信息

存储在一个单独的表中,您只需在查询中加入表格,即可获得快速简单的信息


ma ******** @ gmail.com 写道:
I frequently see people who try to put comma separated data into a
database field. I frequently advice them not to.

Put the information in a separate table, much like Terry Olsen
suggested, only use the id of the site and the person if possible.

If you put all sites for a person in a single field, that field is more
or less useless for database operations. If you for instance want to
list all the persons responsible for different sites, you have to write
a lot of code to look up the information. If you store the information
in a separate table, you just join the tables in a query, and you get
the information fast and simple.
ma********@gmail.com wrote:
大家好,

我正在asp .net和vb .net中编写应用程序。我的问题只是验证我需要参加一个正式的编程课程,而不是这个即时学习课程。东西:)

这是情况。我有一个人们将从不同的站点代码访问的站点(站点代码=建筑物ID)。每个用户都有一个
配置文件,以及基于配置文件的系统权限。用户目前只能对他/她所在的网站代码(建筑物)进行数据库更改。我希望能够添加
能力来制作一个用户负责几个站点。所以,现在,我有一个带有site_code列的sql数据库,该列保存了用户的网站ID。

我遇到的问题是如何管理用户的多个站点代码
当我不知道他/她是否将负责1,2,3,4或更多
站点时。这对我来说是有意义的,我感谢您对此的任何意见。

我应该能够存储用户可以访问的一个或多个站点代码。一个数据库列。也许用空格或逗号分隔
或者我不知道。

当我加载这些网站代码时,我应该使用某种数组或
集合吗?现在我们进入asp .net部分。我需要在会话中存储这些信息,以便跨页面提供。 Eitehr
方式,当我进入我需要查看用户有权使用的网站代码的例行程序时,我应该可以执行以下操作:

site_code in< something>
''检查网站代码的内容并确定应该做什么


我有意义吗?我对这种事情缺乏经验。
谢谢!
Hi all,

I''m writing an application in asp .net and vb .net. The question I have
just verifies I need to take an official programming course instead of
this "learning on the fly" stuff :)

Here''s the situation. I have a site that people will access from
different site codes (site code = building ID). Each user will have a
profile, and permissions to the system based on the profile. The user
currently can only makes changes to the database for the site
code(building) he/she resides in. I''d like to be able to add the
ability to make a user responsible for several sites. So, for now, I
have an sql database with a site_code column that holds the id of the
site for the user.

The issue I am having is how to manage multiple site codes for a user
when I don''t know if he/she will be responsible for 1,2,3,4, or more
sites. Here is what makes sense to me, and I appreciate any input on
this.

I should be able to store the one or more site codes the user has
access to in one database column. Maybe delimited by spaces or commas
or I don''t know.

When I load these site codes, should I use some kind of array or
collection? Now we are getting into the asp .net part. I need to store
this information in session so it is available across pages. Eitehr
way, when I get to a routine where I need to check the site codes a
user has permission to, I should be able to do something like:

For each site_code in <something>
''check whatever against the site code and determine what should be
done
Next

Am I making any sense? I am inexperienced with this kind of thing.
Thank you!



好主意,但你如何处理多个负责多个人的人? >
网站?在表格列中使用分隔符时,我已经能够使用like进行

搜索。运营商。

-

丹尼斯在休斯顿

G ?? ran Andersson写道:
Good idea but how do you handle multiple persons responsible for multiple
sites? When using delimiters in a table column, I have been able to conduct
searches using the "like" operator.
--
Dennis in Houston
"G??ran Andersson" wrote:
我经常看到那些试图将逗号分隔的数据放入
数据库字段的人。我经常建议不要这样做。

将信息放在一个单独的表格中,就像Terry Olsen建议的那样,只使用网站的ID和人员的ID。

如果您将一个人的所有站点放在一个字段中,那么该字段对于数据库操作来说更无用或更少用。例如,如果您想列出所有负责不同网站的人员,您必须编写大量代码来查找信息。如果您将信息存储在一个单独的表中,您只需在查询中加入表格,就可以快速而简单地获取信息。
ma ******** @ gmail.com 写道:
I frequently see people who try to put comma separated data into a
database field. I frequently advice them not to.

Put the information in a separate table, much like Terry Olsen
suggested, only use the id of the site and the person if possible.

If you put all sites for a person in a single field, that field is more
or less useless for database operations. If you for instance want to
list all the persons responsible for different sites, you have to write
a lot of code to look up the information. If you store the information
in a separate table, you just join the tables in a query, and you get
the information fast and simple.
ma********@gmail.com wrote:
大家好,

我正在asp .net和vb .net中编写应用程序。我的问题只是验证我需要参加一个正式的编程课程,而不是这个即时学习课程。东西:)

这是情况。我有一个人们将从不同的站点代码访问的站点(站点代码=建筑物ID)。每个用户都有一个
配置文件,以及基于配置文件的系统权限。用户目前只能对他/她所在的网站代码(建筑物)进行数据库更改。我希望能够添加
能力来制作一个用户负责几个站点。所以,现在,我有一个带有site_code列的sql数据库,该列保存了用户的网站ID。

我遇到的问题是如何管理用户的多个站点代码
当我不知道他/她是否将负责1,2,3,4或更多
站点时。这对我来说是有意义的,我感谢您对此的任何意见。

我应该能够存储用户可以访问的一个或多个站点代码。一个数据库列。也许用空格或逗号分隔
或者我不知道。

当我加载这些网站代码时,我应该使用某种数组或
集合吗?现在我们进入asp .net部分。我需要在会话中存储这些信息,以便跨页面提供。 Eitehr
方式,当我进入我需要查看用户有权使用的网站代码的例行程序时,我应该可以执行以下操作:

site_code in< something>
''检查网站代码的内容并确定应该做什么


我有意义吗?我对这种事情缺乏经验。
谢谢!
Hi all,

I''m writing an application in asp .net and vb .net. The question I have
just verifies I need to take an official programming course instead of
this "learning on the fly" stuff :)

Here''s the situation. I have a site that people will access from
different site codes (site code = building ID). Each user will have a
profile, and permissions to the system based on the profile. The user
currently can only makes changes to the database for the site
code(building) he/she resides in. I''d like to be able to add the
ability to make a user responsible for several sites. So, for now, I
have an sql database with a site_code column that holds the id of the
site for the user.

The issue I am having is how to manage multiple site codes for a user
when I don''t know if he/she will be responsible for 1,2,3,4, or more
sites. Here is what makes sense to me, and I appreciate any input on
this.

I should be able to store the one or more site codes the user has
access to in one database column. Maybe delimited by spaces or commas
or I don''t know.

When I load these site codes, should I use some kind of array or
collection? Now we are getting into the asp .net part. I need to store
this information in session so it is available across pages. Eitehr
way, when I get to a routine where I need to check the site codes a
user has permission to, I should be able to do something like:

For each site_code in <something>
''check whatever against the site code and determine what should be
done
Next

Am I making any sense? I am inexperienced with this kind of thing.
Thank you!



这篇关于不确定如何描述这个问题......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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