TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
hery
NA
7
0
How to embed variable value in sqldatasource session parameter in c#
Feb 22 2011 2:13 PM
I want to question how to embed variable value in sqldatasource session parameter in c#. This is mycode:
default.aspx:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Ora2011 %>"
ProviderName="<%$ ConnectionStrings:Ora2011.ProviderName %>"
SelectCommand="SELECT ID, CATEGORY_NAME FROM (:INVENT_CATEGORY)">
<SelectParameters>
<asp:SessionParameter Name="INVENT_CATEGORY" SessionField="INVENT_CATEGORY" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
C#:
protected void Page_Load(object sender, EventArgs e)
{
string table = "V_INVENTORY"
Session["INVENT_CATEGORY"] = table;
}
When i run this program, i get error "invalid table name". Why i can't embed variable into sqldatasource from session parameter. Thanks for your help
Anyone help me in my problem. Thanks
Reply
Answers (
1
)
Session Problem
genrichandler