Wrox Programmer Forums
|
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 August 26th, 2003, 02:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default ado.net with asp.net

I'm trying to use ado.net with asp.net because binding seems to be very limited. Here is my problem, I want to break apart the dates coming out with DatePart like this:

<% Dim curmonth
curmonth = monthname(datepart("m", #Container.DataItem("Event_date"))) & " " & DatePart("yyyy", #Container.DataItem("Event_date")) %>

With Classic ASP it makes a date like this 1/5/03 look like this:
January 2003.

I'm getting an Expression expected on the curmonth = monthname ... line.

With classic ASP I used rSet("event_date"). What is the equivalent in ASP.NET?
 
Old August 26th, 2003, 03:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Nevermind, I figured it out.

Here is the shortened code for those beginners like me:

<%#monthname(datepart("m", Container.DataItem("event_date")))%>
 
Old August 27th, 2003, 08:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Quote:
quote:Originally posted by stu9820
 Nevermind, I figured it out.

Here is the shortened code for those beginners like me:

<%#monthname(datepart("m", Container.DataItem("event_date")))%>


Is there a way to code this:

<%#monthname(datepart("m", Container.DataItem("event_date")))%>

into a variable?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you use Asp 3.0 with ADO.NET? handles Classic ASP Basics 0 September 30th, 2005 07:37 PM
'like' problem with asp.net/ ado badgolfer Access ASP 2 September 16th, 2004 01:50 PM
ADO.NET with ASP.NET stu9820 ADO.NET 5 September 2nd, 2003 11:47 AM
Beginning ASP.NET E-Commerce (ADO error) dianastudy3 All Other Wrox Books 3 July 30th, 2003 11:51 PM
MSDE and SQL CE (using VB.NET and ADO.NET) LEGS ADO.NET 0 July 12th, 2003 11:27 AM





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