0

At my work, in another location, they have a server with data I want to query. I built a VB.net application and was able to put together a SQL query and return the info. But now I have built a website, html/css/js, and I can't figure out how to do the same thing.

I have read that firing the SQL query from javascript is not a good way to do it. Everything I am reading seems to point to using node.js.

But, I can't download and install node.js on work computers. And, I can't test at home, because the server is on an intranet that I can't access from home.

So, I am stuck. Can someone point me in the right direction.

To summarize: I want to send a request to the SQL Server and get back some data to display on this website.

Not actual vb.net code, but looks like this...

myConn = New SqlConnection("Initial Catalog=Northwind;" & _
            "Data Source=localhost;Integrated Security=SSPI;")

Everything I found on the net that looked like this code, didn't work.

3
  • The key thing to realise is that HTML/CSS/JS all run in the client browser, while it is technically possible to connect directly to a database from the client browser its rare and not recommended. Therefore you need to write some server side code. Node.js is one of many server side languages. But from what you are saying you probably can't run server side code - because server side code has to be hosted somewhere, and that somewhere has to have permission to talk to SQL Server. So you might be stuck. Commented May 13, 2019 at 4:04
  • Possible duplicate of Connecting to SQL Server Database using a Hosted Web Application Commented May 13, 2019 at 4:32
  • Thanks for the reply. Can you elaborate on he server side code aspect. Does that mean that I have to be writing code on the actual server itself? What would the process be like? I’m totally new to this aspect of programming and don’t really know where to start. Even though it might be impossible for me in this situation, I’m still curious to know how it would work. Commented May 13, 2019 at 22:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.