Thanks. Trouble is I've no idea what you are talking about as this is all stuff I've never used. Basically by end of play tomorrow I've got to produce a web service which returns data from a sql server db in json format so our javascript can call it and populate our vash files. Or I might have to stick a dll or two in there. Could do with some example code. When I talk or read about this **** it all sounds like gobbledegook but when you get stuck in it starts to make sense.
SQL Server can return queries as XML as opposed to normal result sets. XML is very easy to convert to JSON via XSL. Dunno what vash files are. You don't know what DLL's are. If you did you wouldn't be talking about them like that. If you want example code am happy to help
What language are you working with? I use JSON.net with my c# **** - could knock you up something in about 5 mins in the morning if you're still struggling.
I think I'll be ok getting the web service to fetch data from the db in json format, just calling it from our stuff is where i'll struggle. Maybe need a dll in between the javascript and the web service? Vash files are I think from Angular, either that or Node. All new stuff to me.
No, you shouldn't need a DLL (unless you plan to share the code across various projects). Your web service can connect straight to the database, it's the middle layer, then the JavaScript contacts to the webservice directly.
OK...my understanding is: Vash files (Angular.js or Node.js?) which have javascript files which do **** to the json data which (at the moment) is coming from a dll which calls direct to the db. I've got to replace the dll communicating with the db with a web service in web api 2 which is some asp.net thing for which i had to install visual studio 2013.
I thought that's probably how it should work but the boss mentioned a dll so i dunno what he's thinking.
Here's a simple example using .NET http://www.codeproject.com/Articles/167159/How-to-create-a-JSON-WCF-RESTful-Service-in-sec Note this bit (which doesn't come out too well on here) It's the 'GetData()' method that you will be looking to connect to the database in and return whatever values it is look for (as defined in the class 'Person'). I'd recommend using LinqToSQL as a quick way to retrieve whatever data you need from the database. In terms of the Javascript interaction with the JSON rest service - you'd basically be looking for your .net service to mimic the expected json structure that is currently being read, then just point the javascript to the new service?
No. DLL's live on the operating system (they are a Dynamic Link Library (DLL)). If written in a .NET language such as C# they can also be easily embedded into SQL Server. If native DLL's they can be connected to and called from SQL Server but that's a ridiculously stupid and complicated thing to do. You don't have DLL's in between anything. They're shared code called by your code. Ok, back to basics. What do you have at the moment? You seem to think you have a callable web service. Is so, in a web page call it's URL from Javascript using an XHR instance. That will return the JSON to you which you can then use JavaScript to manipulate the JSON. Alternatively, use the AJAX.NET bollocks in which case yer on yer own and am out.
...and more AJAX.NET ****e. You don't need it. Keep it simple by using JavaScript and XHR. You get the added bonus of keeping your front end separate from the back end (IIS or Apache) by simply replacing the service URLs. For example http://mysite/services/getdata.ashx when on IIS, and http://mysite/services/getdata.php when on Apache. Either way the getdata service returns the expected JSON to the front end for consumption by the calling page's JavaScript.
I've just read the start of this thread and realised that they have specifically asked for Web API 2 (as a test, rather than a practical task), which is not the example I gave. Anyway I haven't worked with this yet (and I've just put it on the list of things to learn whilst still being paid in my current job, before my current job goes, so I can whore off the skills to the next employer) - but this seems to be a decent example using Jquery http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api **** knows how to make it output JSON --- edit I've just actually read through this article and it outputs JSON - so this should be sufficient by itself.
Erm, it is still AJAX. Just because Microsoft choose to call it a different name means **** all. It's still the XHR object being used to GET/POST asynchronous requests. If you want to rely on Microsoft generated ****e to wrap the basics up and bind you to their platform that's up to you.
I tried to edit it to AJAX.NET quickly before you got yer reply in, which was back in the .net 2.0 days. Anyway - they have asked him to do it in Visual Studio so he should probably follow the Microsoft getting started guide - he can make his mind up on how clean he wants his future code to be if he still has a job next week.
...furthermore, never heard of JSON.NET Why the **** would you need a library to generate/consume JSON? JavaScript already understands JSON, it is it's own object notation after all. So that leaves us with generating JSON for returning over a web service. Yep, all kinds of bollocks Mircrosoft makes available for that. Writing C# objects with particular attributes for example and being forced to use a particular web service type that forces you write said C# objects. I've actually seen morons do that. They pull data from a database, transform the data result set into C# objects just so they can have "automatic" conversion into JSON Any time the schema changes they have to rewrite their C# objects to keep up with this really neat automatic way ****in morons
I've nothing against using Microsoft technologies. In fact, that's mostly what I use. It's important to realise that most of it is ****e, particularly when it comes to web technologies. Use the good bits and eschew the ****e bits.
I've nothing against using Microsoft technologies. In fact, that's mostly what I use. It's important to realise that most of it is ****e, particularly when it comes to web technologies. Use the good bits and eschew the ****e bits.