Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 20th, 2006, 10:28 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Assigning Context.Items Value To SQL Query

Hi all,

Can anyone help me out with this? I have passed a value from a previous page and want to use it in an SQL query on Page load, here's some code to show you what I mean

dim Str1 as String
Str1 = Context.Items("appt_date")
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=D:\Inetpub\wwwroot\WebApplication1\Medical. mdb;")
dbconn.Open()
sql="SELECT * FROM Appointment WHERE appointment_date= '+ Str1 +' "

Thought I could maybe assign the value to a string first or maybe it can't be done like this, can anyone help??

 
Old April 20th, 2006, 01:45 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

is there an error? are you getting the value?

You can use session variables or a query string as well






Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
Unable to set context in web.xml or context.xml. dchicks Apache Tomcat 1 March 7th, 2008 07:59 AM
Assigning Command Button to Query young20 Access VBA 1 November 6th, 2006 12:15 PM
Using Items.Context with Server.Transfer jazzcatone ASP.NET 1.0 and 1.1 Basics 0 August 27th, 2006 04:53 PM
How to fill a combobox with the items from a query MacDevv C# 1 August 21st, 2006 07:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.