Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #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,


Reply With Quote
  #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

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

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

Jaime E. Maccou
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 01:12 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.