Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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
  #1 (permalink)  
Old January 11th, 2005, 11:00 AM
Registered User
 
Join Date: Nov 2004
Location: Houston, TX, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default .net and c# complex bindgrid page

I currently have a page that displays 12 months in the form of bindgrids. I am trying to match the current year so that each of the bindgrids match the date displayed on the page. The current year is 2005 and the bindgrids should only show information relevant to the year 2005. My question is do I change my bindgrids to pull the year (by using convert or cast or changing the string format) and set it equal to the current year?

Also, I have tried to convert, cast and change the stringformat of a column in my db but I only receive errors:

This doesn't seem to work-
Date.Text = String.Format("{0}", (objRead["date"].ToString("{mm/dd/yy}")));


I also have not been successful in using cast or convert. The two columns in my database I have tried to use are of datatype smalldatetime and nvarchar.


Paging will eventually occur to go forward (2006, 2007, etc.) and backward (2004, 2003, etc.)


I'd appreciate anyones help,

K

  #2 (permalink)  
Old January 16th, 2005, 04:23 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Do you want the SQL statement to convert or in C#?

Code:
System.Convert.ToDateTime(<put your date string here>);


Jaime E. Maccou


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET bug: Error reflecting complex object with Nul peterwood .NET Web Services 0 February 7th, 2008 11:35 AM
access C#.Net page as action of calssic ASP page mansharma_s ASP.NET 1.x and 2.0 Application Design 6 January 7th, 2008 10:58 AM
ASP.NET - Static Page and Dynamic Page sohrabus ASP.NET 2.0 Professional 2 April 18th, 2007 11:42 PM
c# complex datagrid page KarmenC C# 0 January 11th, 2005 11:35 AM





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