Ok, so my end solution was to create users in SQL, and give them passwords, and assign databases there. Then when they log in, the program uses session variables to hold their login data. This code also tests the login info, and changes a label into an SQL error code, if one is produced. If the test passes, it simply redirects to the destination page.
Imports System.Data.SqlClient
Public Class login
Inherits System.Web.UI.Page
Protected Sub LoginButton_Click(sender As Object, e As EventArgs) Handles LoginButton.Click
Session("Username") = textUserName.Text
Session("Password") = textPassword.Text
Session("Database") = textDatabase.Text
Dim queryString As String = "LOGINPROPERTY ( '" + Session("Username") + "' , 'property_name' )"
Session("ConnectionString") = "Data Source=MyServerNameHere;User ID=" + textUserName.Text + ";Password=" + textPassword.Text + ";database=" + textDatabase.Text
Dim connection As New SqlConnection(Session("ConnectionString"))
Dim command As New SqlCommand(queryString, connection)
Try
connection.Open()
Response.Redirect("destination.aspx")
Catch ex As Exception
LabelError.Text = ex.Message
Finally
End Try
End Sub
End Class
Each page which uses the database then has this code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (Session("ConnectionString") IsNot Nothing) Then
SqlDataSource1.ConnectionString = Session("ConnectionString")
End If
End Sub