Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7936515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:14:27+00:00 2026-06-03T22:14:27+00:00

I am creating a custom log in page using VB in Visual Studio. Every

  • 0

I am creating a custom log in page using VB in Visual Studio. Every time I try logging in, however, I get the following error:
“Incorrect syntax near ‘.'”.
When I put in the wrong username/password combo it recognizes this, but when it is right it will get this error and fail to log in.

        Private Function VerifyLogin(ByVal UserName As String) As Boolean
    Try
        Dim cnn As New Data.SqlClient.SqlConnection
        cnn.ConnectionString = My.MySettings.Default.RedwoodConnectionString.Replace(";Integrated Security=True", ";Integrated Security=False") & UserSetting
        Dim cmd As New Data.SqlClient.SqlCommand
        cmd.Connection = cnn
        cmd.CommandType = CommandType.Text
        cmd.CommandText = "SELECT COUNT (principal_id) FROM _ sys.database_principals WHERE(name = '" & UserName & "')"
        cnn.Open()
        Dim i As Integer
        i = cmd.ExecuteScalar()
        cnn.Close()
        If (i > 0) Then Return True
        Return False
    Catch ex As Exception
        System.Windows.Forms.MessageBox.Show("Error: " & ex.Message & vbNewLine & "Location: VerifyLogin() in Login.vb" & vbNewLine & "Returned value: False")
        Return False
    End Try
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:14:29+00:00Added an answer on June 3, 2026 at 10:14 pm

    Look at this portion of your sql:

    FROM _ sys.database_principals

    See the mistake there? It thinks the _ is the full table name and sys is an alias. At this point, .database_principals is no longer valid, hence your error.

    And while we’re at it, you really need to fix the sql injection vulnerability!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The permission/authentication documentation for Django 1.4 provides the following snippet for creating custom permissions
I am creating a Prism 2.1 app in which I have implemented logging, using
I am trying to create a VSPackage project (using the Visual Studio 2010 SP1
I'm creating an installer for a website that uses a custom event log source.
I've seen a few questions here and there about creating event log sources using
I have tried creating a syntax highlighter for a custom file definition. I get
I'm creating a MSI. When I try to install it through msiexec /lvxe log.txt
I'm often creating custom assertion methods for my JUnit tests. eg: public void assertArrays(String[]
I'm creating custom forum software for a site I'm building, which includes 2 tables
I am creating custom cell in my iphone aap and I am also adding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.