避免重复条目 [英] Avoid Duplicates Entries

查看:75
本文介绍了避免重复条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

首先,我想清楚地解释一下我的问题。

1.我有一个Aspx页面。 (Test.aspx)
2.使用3个Web用户控件(demo1.ascx,demo2.ascx,demo3.ascx)并在我的aspx中调用所有这三个控件。
3.我在sql中有3个表(国内,国际,商业)
4.国家 - 包含与国家
相关的数据5.国际 - 包含与国际有关的数据
5 .Business-包含与Business
相关的数据3.这里我的用户控制从DB检索数据。 (EX:< b > demo1.ascx - 国家< / b >
< b > < i > < / i > demo2 .ascx - 国际< / b >
< b > demo3.ascx - 业务< / b >

< b > 现在我在国家,国际和商业表格中放入相同的数据< < span class =code-leadattribute> / b >

所以当我运行我的aspx页面时,所有3个用户控件有相同的数据,但我想避免在我的aspx页面中重复的内容。这里只是在我的aspx页面调用用户控件并仅传递参数。

解决方案

将数据绑定到第一个控件时,将ID保存在字符串中数组,然后将其保存在会话中......当将数据绑定到第二个控件然后从会话中检索字符串数组并在第二个控件中绑定之前借助此字符串数组过滤数据并使用第三个控件重复此操作..... ..

Hi All,

             First i wanna clearly explain my problem.

 1.I have one Aspx page. (Test.aspx)
 2. Am using 3 web user controls (demo1.ascx,demo2.ascx,demo3.ascx)and call all the three at  my aspx.
 3. I have 3 tables in sql (National, International, Business)
 4. National- Contains data related to National
 5. International-  Contains data related to International
 5. Business-  Contains data related to Business
 3. Here my user controls retrieve data from DB. (EX: <b>demo1.ascx - National</b>
 <b><i></i>demo2.ascx - International</b>
 <b>demo3.ascx - Business</b> )

<b>Now i am Put same data in both National,International and Business table</b>

so when am run my aspx page all the 3 user controls having same data, but i wants to avoid repeated contents in my aspx page. Here am just call user controls at my aspx page and pass parameter only.

解决方案

when bind data to 1st control, save ids in string array and then save it in a session... and when bind data to 2nd control then retrieve string array from session and filter data with the help of this string array before binding in 2nd control and repeat this with 3rd control.......


这篇关于避免重复条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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