I connect to my Microsoft SQL Server database using 

express (https://www.npmjs.com/package/express)
mssql (https://www.npmjs.com/package/mssql)

Then ip.address/api/addresses I get the data that I need

On Wednesday, October 4, 2017 at 6:32:46 PM UTC-7, hassan mohamed wrote:
>
> Hi I want to connect to sql server express  from angular 2 app. I was able 
> to connect to database  in TypeScript app using VS 2013  using the class 
> shown below ( I got it from internet). Now I searched if I can do the same 
> in Angular 2 app but did not find anything similar; when I tried to use the 
> code in angular 2 I get error for ActiveXObject
>
> class DataConnectivity {
>     LoadDB() {
>         var connection = new ActiveXObject("ADODB.Connection");
>
>         var connectionstring = "Data Source=USER-PC\\SQLEXPRESS;Initial 
> Catalog=AdventureWorks2012;integrated Security=SSPI;Provider=SQLOLEDB";
>         connection.Open(connectionstring);
>         var rs = new ActiveXObject("ADODB.Recordset");
>         rs.Open("select top (20)* from Person.Address", connection);
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to