AllExperts > Experts 
Search      

VB.NET

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB.NET Answers
Question Library

Ask a question about VB.NET
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Stephen Jackson
Expertise
I can help with questions regarding VB.NET syntax and object references, with data interfaces and with the design and creation of robust, data aware object classes. I can also be very helpful with creating distributable applications and provide tricks and tips on .msi creation. I also have extensive experience in designing SQL Server Databases and interfacing them with VB.NET. I try to avoid web specific questions, as that is an area of expertise all its own.

Experience

Experience in the Area:
I have been a programmer in Visual Basic since version 1.0 and have worked with VB.NET (which is infinitely more powerful than previous versions) since its initial release and SQL Server, both as a corporate IT professional and professional consultant. I first wrote Basic in 1976 on a TRS 80 and have worked in Visual Basic 1.0 and every subsequent release of Microsoft Visual Basic. I worked for over 7 years as a Senior Level Consultant in the area and currently hold a Project Manager position in IT.

Education and Credentials:
MBA in Econometrics, 1983, University of Memphis. BBA in Financial Management, 1982, Fogelman College of Business and Economics, University of Memphis.
Microsoft Certified Professional

Areas of Special Expertise:
My specialty is the design of Object Oriented Solutions with robust, data aware object classes. I generally avoid the classic ‘Three Tier’ model as I find it redundant and cumbersome to maintain. I also specialize in the creation of ‘User Friendly’ User Interfaces which help lessen the need for user training and help prevent user error. I work best with Windows Forms based applications, and while I do work in C# as well, I prefer to limit my questions here to Windows Forms based applications created in Visual Basic.NET and SQL Server. I wil also address questions relating to the distribution and installation of Windows Forms based applications created in VB.NET.
 
   

You are here:  Experts > Computing/Technology > Basic > VB.NET > insert rows of datagridview into sql server table

Topic: VB.NET



Expert: Stephen Jackson
Date: 2/8/2008
Subject: insert rows of datagridview into sql server table

Question
Hi,

I am new to VB.net programming. I need your help in the following issue.

I have a excel data with set of rows and columns (e.g.. 10 rows and 5 columns..1st row containing headings). Now the problem is, I want to add few more columns dynamically (ofc. data in that columns is same for all the rows). Now I want to insert(append) these updated records into SQL server table.

I able to read the excel file and read the contents into datagridview. but here I cant do the append part.
Which is the best way to update the database.
Please advice.

Thanks

Answer
Mahesh,

Office automation is always a tricky business, especially when you wish to take data from Excel and place it into a relational database.  Not knowing the specifics, I would recommend you look at several things.  First, Excel interprets data as numeric or string according to its own rules, and will often reveal numeric data as formatted, you you may be better off first placing the information into character fields in SQL Server (in a loading table) then converting to the correct data type there. Another issue along these lines may be the field sizes of the destination tables.  Your text fields (or numerics) may be interpreted as too large to fit into the destination  fields.  Another important thing to consider is whether the destination table has any restrictions, indexes or keys which might be preventing your data from being appended to the SQL table.

Of course you also have to have the same number of columns, and the information must be in the correct order of fields.  I hope this enough to help, but if not, please feel free to ask for clarification.  I will do what I can to help!

If this information has been helpful, please be kind enough to leave me some positive feedback, as well.

Good luck!

Stephen Jackson

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.