HOW TO IMPORT EXCEL DATA TO DATABASE USING AJAX AND CLOSEDXML LIBRARY IN MVC C#

  Рет қаралды 5,617

LahilaTech

LahilaTech

2 жыл бұрын

In this tutorial we will learn how to import data from excel file to database (SQL Server), we also use MVC C# database first framework, ajax post and ClosedXML library. I hope you are familiar with those framework/library.
#mvc-c#, #databasefirst, #closedxml, #sqlserver, #excelimportusingaJax
All content of this channel aims to share how to program using ASP.Net C# programming language.
if you feel this channel beneficent you, don't be hesitate for subscribe, press the like button and turn on the bell notification.

Пікірлер: 14
@Booster09999
@Booster09999 Жыл бұрын
I have trying it but the button is not working
@abdalrhmanfahiem9501
@abdalrhmanfahiem9501 2 жыл бұрын
@sallyparkes4329
@sallyparkes4329 Жыл бұрын
Hi, I've managed to get some of my data to import but not all columns. What code do I need to import 3 Excel columns (which are numeric) and store them in an int field and decimal fields? Those three columns are failing to import. The int field just shows 0 for all records which the two fields that are decimal are empty. Thank you.
@lahilatech5946
@lahilatech5946 Жыл бұрын
Did you assigned your data from excel to correct column of the table? i am worried you assign the data to wrong column. Will be better if you debug your code to see if there any mistake on it.
@sallyparkes4329
@sallyparkes4329 Жыл бұрын
@@lahilatech5946 thank you so much for your swift reply. I worked it out just now. I just had to put Convert.ToInt32(ProjectID)!!
@lahilatech5946
@lahilatech5946 Жыл бұрын
​@@sallyparkes4329 yes, you need to converted it. decimal.Parse(your string) for decimal column
@tookay5
@tookay5 Жыл бұрын
wouldn't this take a significant time for a file with 10s of thousands of rows? Normally you would want to save a data upload using a bulk insert mechanism.
@shubhamparade533
@shubhamparade533 2 жыл бұрын
How to avoid duplicate records insert
@lahilatech5946
@lahilatech5946 2 жыл бұрын
it's simple, you can achieved that by doing validation all items on excel list before you saved item to the database.
@Booster09999
@Booster09999 Жыл бұрын
I gett in error on $, document.ready(function (){})
@lahilatech5946
@lahilatech5946 Жыл бұрын
Have you include the jquery file correctly?
@Booster09999
@Booster09999 Жыл бұрын
@@lahilatech5946 yes need to any packages ?
@MOHAMMADIMRAN-by3ge
@MOHAMMADIMRAN-by3ge Жыл бұрын
vendors.bundle.js:1 Uncaught TypeError: Illegal invocation at r (vendors.bundle.js:1:71005) at Se (vendors.bundle.js:1:70897) at _.param (vendors.bundle.js:1:71196) at Function.ajax (vendors.bundle.js:1:74515) at HTMLButtonElement. (UploadFromExcel.js:23:19) at HTMLButtonElement.dispatch (vendors.bundle.js:1:41525) at g.handle (vendors.bundle.js:1:39555)
@lahilatech5946
@lahilatech5946 Жыл бұрын
Hi Mohammad Imran, i thought the problem is on your ajax post parameters. can you post your ajax function?
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 42 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 10 МЛН
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 42 МЛН