Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 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 April 3rd, 2009, 10:28 AM
Authorized User
 
Join Date: Mar 2009
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default nTier example ... ho to import records from external files

I've downloaded great example of Imar Spaanjaar.

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=476

I've created a script for import records from excel file ... Can you tell me how to integrate the script in nTier example?

Do you think that is it possibile to do this:

in che script, after reading each row, do something like this:

Person person = new Person();
person.firstname = ....
person.lastname = ...

and then save the record readed in DB using:

PersonManager.Save(person);


Can you tell me if this is OK?? Read each record and call .Save method with each record readed from Excel!

Thanks
 
Old April 4th, 2009, 05:02 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, that's certainly a good way to do it if you want to import records from Excel using the object model (and thus using validation, for example).

As an alternative, you could directly insert into SQL. However, that means you loose the checking of rules that takes place in the business layer.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
External JS files Ben Horne Javascript 3 July 25th, 2008 02:00 AM
importing external asp files? neddyoats Classic ASP Basics 2 February 6th, 2007 07:26 PM
Rename external files from within access timmaher Access VBA 1 March 24th, 2004 10:37 AM
External JS Files koneruvijay VS.NET 2002/2003 4 February 27th, 2004 07:28 AM
.asp request from Excel (Import External Data) chs245 Classic ASP Basics 1 October 6th, 2003 04:24 PM





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