net.isIP不是一个函数

时间:2017-05-05 10:09:20

标签: azure ionic-framework

我正在尝试使用繁琐的连接到离子框架上的Azure SQL数据库。 我也安装了browserify,但是当我运行代码时,我得到net.isIP不是一个函数

try {      
    var Connection = require('tedious').Connection;
    var Request = require('tedious').Request;
    var TYPES = require('tedious').TYPES;
    var config = {
        userName: 'xxxx',
        password: 'xxxx',
        server: 'xxxxx.database.windows.net',
        options: {
            database: 'xxxxx',
            encrypt: true,
            rowCollectionOnRequestCompletion: true
        }
    };
} catch (err) { alert(err.message); }
var errorVariable = document.getElementById("error");
$scope.Login = function(){
    var username = document.getElementById("userName").value;
    if(isEmpty(username)) {
        errorVariable.style.display = 'block';
        errorVariable.innerHTML = "Your Username Cannot be Empty";
    } else {
        alert("connecting");
        try {
            var connection = new Connection(config);
        } catch (err) { alert(err.message); }
            connection.on('connect', function (err) {
                // If no error, then good to go...
                alert("connected");

            }); 
        } catch (err) { alert(err.message); }

    }
}    

0 个答案:

没有答案