选择带有会话电子邮件的表 [英] selecting table with Session email in
问题描述
以下代码给出了错误
解析器错误消息:服务器标记的格式不正确.
基本上,问题是当我添加email ="Session [email]"时出现了一些错误.任何想法如何解决?谢谢
< asp:sqldatasource id ="SqlDataSource1" runat ="server" connectionstring =<%$ ConnectionStrings:ConnString%>"
selectcommand ="SELECT * FROM [drpdwn]其中email =" Session [email]"
onselecting ="SqlDataSource1_Selecting1">
Hi the following code gives error
Parser Error Message: The server tag is not well formed.
Basically the problem is when i added email="Session[email]" there is some error in it. Any ideas how to fix it? Thanks
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:ConnString %>"
selectcommand="SELECT * FROM [drpdwn] where email="Session[email]""
onselecting="SqlDataSource1_Selecting1" >
推荐答案
ConnectionStrings:ConnString%>"
selectcommand ="SELECT * FROM [drpdwn]其中email =" Session [email]"
onselecting ="SqlDataSource1_Selecting1">
ConnectionStrings:ConnString %>"
selectcommand="SELECT * FROM [drpdwn] where email="Session[email]""
onselecting="SqlDataSource1_Selecting1" >
SQL选择的语法,其中带
.
Syntax for SQL Select with where.
SELECT column_name(s)
FROM table_name
WHERE column_name operator value;
//your query should be like below
select * from [dp] where email = session;
按照链接了解更多基础知识...
http://www.w3schools.com/sql/sql_where.asp [
follow the link to learn more basics...
http://www.w3schools.com/sql/sql_where.asp[^]
mark as answer if solves your problem, it motivates :)
检查您的连接字符串
selectcommand ="SELECT * FROM [drpdwn]其中email =''Session [email]''"
onselecting ="SqlDataSource1_Selecting1">
检查此
Check ur connection string
selectcommand="SELECT * FROM [drpdwn] where email=''Session[email]''"
onselecting="SqlDataSource1_Selecting1" >
check this
这篇关于选择带有会话电子邮件的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!