Wrox Programmer Forums
|
BOOK: Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services
This is the forum to discuss the Wrox book Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services by Brian Knight, Devin Knight, Mike Davis ISBN: 978-0-470-49692-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Knight's 24-Hour Trainer: Microsoft SQL Server 2008 Integration Services 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 18th, 2012, 08:21 PM
Registered User
 
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Lesson 23 C# code

Thought I'd post the c# code Lesson 23 -
I saw some earlier questions about c# code for the scripts and the IsDate() isnt as handy in c# as it is in VB.

public override void Input0_ProcessInputRow(Input0Buffer Row)
{
if (IsDate(Row.DateFirstPurchase) == false)
{
Row.DateFirstPurchase = DateTime.Now.ToString();
}
if (IsDate(Row.BirthDate) == true)
{
Row.DirectRowToValidateddata();
}
else
{
Row.DirectRowToBadData();
}

}

public bool IsDate(string sdate)
{
DateTime dt;
bool isDate = true;

try
{
dt = DateTime.Parse(sdate);
}

catch
{
isDate = false;
}

return isDate;

}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 5 variant - unable to work if code is located in a package sunsetisle BOOK: Java Programming 24-Hour Trainer by Yakov Fain 4 April 2nd, 2012 06:54 AM
Errata Lesson 23 pg.284 RMADANAT BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 1 February 2nd, 2012 03:16 PM
Ex 23-3 zavodney BOOK: Stephens' Visual Basic Programming 24-Hour Trainer 2 September 18th, 2011 11:22 PM
Code on page 23 Hugo West BOOK: Professional Enterprise .NET 0 September 2nd, 2011 05:50 AM





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