Import data from .dbf file to SQL Server using AngularJS in ASP.Net MVC

Last Reply 7 months ago By dharmendr

Posted 7 months ago

Hi,

I have one employee.dbf file 

Currently my requirement is that need to import .dbf file data to sql

@{
    Layout = null;
}
<html ng-app="myApp">
<head>
    <title>Index</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.8/angular.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/danialfarid-angular-file-upload/12.2.13/ng-file-upload.min.js"></script>
    <script type="text/javascript">
        var app = angular.module("myApp", ['ngFileUpload']);
        app.controller("myCntrl", ['$scope', '$http',  function ($scope, $http) {
            $scope.mahesh = false;
         
            $scope.UploadFiles = function (files) {
                $scope.SelectedFiles = files;
            };
         
            $scope.AddUpdateEmployee = function () {
                $scope.mahesh = $scope.mahesh;
                var getAction = $scope.Action;              
                    var formData = new FormData();
                    var files = $scope.SelectedFiles;
                    if (files != undefined) {
                        for (var i = 0; i < files.length; i++) {
                            formData.append(files[i].name, files[i]);
                        }
                    }
                    var details = {};
                    details.Name = $scope.Name;
                    formData.append("details", JSON.stringify(details));
                    var getData = myService.AddSt(formData);
                    getData.then(function (tc) {
                        $scope.terms = tc;
                    });
            }             
        }]);
      
    </script>
</head>
<body ng-controller="myCntrl">
    <div class="container">
        <div>
            <div id="wrapper" class="clearfix">
                <form name="userForm" novalidate>
                  
                    <div class="form-horizontal">
                        <div class="form-row">
                            <div class="col-md-4">
                                <label for="COI_Name">
                                    Upload a file
                                </label>
                                <input type="file" ngf-select="UploadFiles($files)" />
                            </div>
                            
                        </div>
                        <div>
                        </div>
                        <div class="form-group">
                        </div>
                        <div class="form-group" style="width: 120%; text-align: center; padding: 10px;">
                            <div class="col-md-offset-2 col-md-5">
                                <p>
                                    <button  ng-model="IsVisible" ng-click="AddUpdateEmployee()">
                                        <span class="glyphicon glyphicon-ok"></span>Submitt
                                    </button>
                                  
                                </p>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
          
        </div>
    </div>
</body>
</html>

 

This question does not have replies that have been liked.