Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 20th, 2012, 09:16 PM
Registered User
 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel data to SQL table

Howdy!

I am currently using ASP.NET 4 this semester and I love it! I am doing different projects with the guide of the book now. I am having a bit of trouble using SQL with Visual Studio Web Development. I can use the files that came along with the book but now I am trying to create my own table. I have a premade table in Excel that consists of ProductID, ProductName, SupplierID, SupplierName, unit price, QuantityPerUnit (ex "12 - 200 ml jars"), etc.

When I try to copy and paste into a table I created in the Data Connections under the Server Explorer, it wouldn't let me copy the data. Eventually I had to to set all the values to "Allow Nulls" which allowed me to copy all the data except the Unit Price.

I have UnitPrice as "Allow Nulls" and the datatype set as "Decimal (19, 4)". Is this incorrect?
Also is having the other ColumnNames set to "Allow Nulls" the best thing to do?


Any help is greatly appreciated! The first time I've ever used SQL is with this book.
 
Old April 21st, 2012, 02:35 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Quote:
I am currently using ASP.NET 4 this semester and I love it!
Thanks! Good to hear.

Copying from Excel is always tricky, as Excel doesn't support true data types as SQL Server does.

I would either manually add the data if it's not too much, or use the SQL Server Import Wizard (requires a commercial version of SQL Server) or Integration Services to import the data. Alternatively you could save the data as CSV and import it pogrammatically.

All of these solutions are beyond the scope of the book and thus this forum category, so you may be better off posting a question in another forum cateogry, succh as one dealing with SQL Server or with (ASP).NET in general.

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
Export SQL table to excel avidan BOOK: Beginning ASP.NET 4 : in C# and VB 2 September 18th, 2011 11:53 AM
How to export the HTML Table data to excel. Piyush Doraya JSP Basics 0 July 19th, 2011 04:34 AM
Export Table data into an Excel SpreadSheet hewstone999 Access VBA 0 March 3rd, 2008 07:00 AM
Displaying Excel data in a table badgolfer ASP.NET 1.0 and 1.1 Basics 6 January 6th, 2006 04:25 AM
Convert SQL table to Excel in VB. anita Pro VB Databases 1 May 13th, 2004 04:58 PM





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