本文介绍了使用一个表的引用并从另一表获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨! 我有两个不同的表.临时的,生动的. 临时表包含所有在线的用户名.并且pictable包含所有已注册用户的图片. 现在我有一个index.aspx页面,其中包含gridview 我要的是在页面加载时检查模板,并为模板中存在的所有用户拍照并在gridview中显示它. 请告诉我该怎么做. 在此先感谢
Hi! i have two different tables. temptable, pictable. the temptable contains all those usersname whos are online. and pictable contains pictures of all the users who are registered. now i have an index.aspx page it contains gridview what i want is to when the page loads it checks the temptable and take pictures of all those users that are present in temptable and show it in gridview. please tell me how to do it. thanks in advance
推荐答案temptable应该包含userid(主键),它是pictable中的引用键 例如 临时表: userid(主键) 用户名 图片: 用户ID(外键) 图片 然后添加gridview并分配具有查询的sqldatasource 选择t.username,p.image 从temptable t加入pictable p 在t.userid = p.userid temptable should contains userid (primary key) which is reference key in pictable for example temptable: userid (primary key) username pictable: userid(foreign key) image Then add gridview and assigned sqldatasource which has query Select t.username,p.image from temptable t join pictable p on t.userid=p.userid
更多推荐
使用一个表的引用并从另一表获取数据
发布评论