Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 June 9th, 2005, 01:12 PM
Authorized User
 
Join Date: Mar 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default concat day, month and years as Date in display

Hi all,

Could someone please show me how to concat day, month and year colums in database as one single column in datagrid ASP.Net VB ? Thanks in advance

I tried the below but it keep giving error :

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The server tag is not well formed.

Source Error:
Line 1: <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
Line 2: <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,culture=neutral" %>
Line 3: <MM:DataSet
Line 4: id="dsEmplRecog"
Line 5: runat="Server"

And here's my code:
<MM:DataSet
id="dsEmplRecog"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_EmplRecog") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_EmplRecog") %>'
CommandText='<%# "SELECT EmplRecog.EmployeeName, EmplRecog.Comment, (EmplRecog.Mon + ' ' + EmplRecog.CommentDay + ' ' + EmplRecog.YYYY) AS CommentDate , EmplRecog.CustName, EmplRecog.ID FROM EmplRecog ORDER BY YYYY DESC" %>'
Debug="true"
></MM:DataSet>
 
Old June 9th, 2005, 05:34 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I would guess that the single quotes in the SQL statement are interfering with the attribute text of the MM:DataSet tag. Try change the data binding syntax for CommandText to a literal string. The binding isn't really doing anything there so you don't need it.

-Peter
 
Old June 29th, 2005, 07:24 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

u can add a unbound col in ur grid and make day mon and year col visbile false and then u can concat and dispaly the value in ur newly creatd col






Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding last day of a month John Anthony Access VBA 9 October 6th, 2008 03:27 PM
make date display go back a day crmpicco Javascript How-To 2 March 16th, 2006 01:42 PM
get year,month,day,hour... kobystud C# 1 July 16th, 2004 04:45 PM
Asp day of month display karib Classic ASP Databases 10 April 5th, 2004 12:56 AM
1st Week-Day of the Month ticktack Classic ASP Basics 2 January 19th, 2004 10:01 AM





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