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
Charles Holt
NA
1
0
Dynamically alter SQL Statement Help Please!!
Oct 26 2006 6:14 PM
I'm trying to dynamically alter an SQL statement by using a variable(u_name), but cannot get it to work. It seems that setting the value in the script does does carry outside the script?? Any help would be appreciated.
<
Script
runat
="server">
Dim
u_name
As
String
=
Me
.User.Identity.Name
</
Script
>
<
asp
:
AccessDataSource
ID
=
"AccessDataSource1"
runat
="server"
DataFile
="C:\Documents and Settings\Charlie\My Documents\Visual Studio 2005\Projects\Student_Database\Enrollment_DB.mdb"
SelectCommand
="SELECT [StudentID], [SSN], [FirstName], [LastName], [Address], [Major], [Student Type] AS Student_Type, [Student Status] AS Student_Status, [Date of Birth] AS Date_of_Birth, [GPA] FROM [Students] WHERE ([xUserName] = @u_name)">
<
SelectParameters
>
<
asp
:
Parameter
Name
="u_name"
Type
="String"
/>
</
SelectParameters
>
</
asp
:
AccessDataSource
>
Reply
Answers (
1
)
programmatically creating xml from txt file......anyone.......help
Creating a forum.