I have built a web interface in Visual Studio 2005. I have also built a database using SQL Server 2005. What I want is a way of connecting to the database from the web interface. I want to be able to access and manipulate the database across the internet via the web interface I have created. The Website will be hosted by a remote server. Is it possible to put a button or hyperlink on the web interface such that when I click it, I can be taken to the databse . Please suggest any useful links. If this is possible, is it also possible to add security so that before I can be taken to the database I should be asked for, say, password

Re: Visual Basic General Visual Studio 2005: connection to database

Squire James

In my opinion, your best bet would be to create a Web Service to handle the database access and security. A Web Service is a set of Functions (or Subs) that can be called from the Internet, and it is one of the options when starting a new project. In its simplest form, you can create a function that simply executes an SQL query given as an argument (returning a Dataset if it's a Select query, for instance). However, it's probably better to create many functions with certain limited functions so the user can only do what you allow him to do!

As for security, you can set up your own database that contains usernames, passwords, and (optionally) permissions to use each Web Service function. The code that calls the function provides username and password as arguments each time it calls a function. The functions themselves check to see if that user got his password right and has permission, and do something approprate if it finds the user has not (throwing an exception back to the caller works nicely).

After you do the Web Service, you alter your interface to call the Web Service functions. This interface can be anything... a Web interface... a Windows interface... anything!