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 8595597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:28:24+00:00 2026-06-12T00:28:24+00:00

I am new to VB.net and creating an application so that user needs login

  • 0

I am new to VB.net and creating an application so that user needs login username and password.

I am using a SQL Server Compact Edition database.

This is my code which works perfect:-

Imports System.Data.SqlClient
Imports System.Data.SqlServerCe

Public Class frm_edit_patient
    Dim con As New SqlCeConnection
    Try
        Dim SQLquery As String
        Dim da As SqlCeDataAdapter
        Dim ds As New DataSet
        Dim myConString As String = My.Settings.Database1ConnectionString
        con.ConnectionString = myConString
        MsgBox("Database is now open")
        MessageBox.Show("connected")
    Catch ex As Exception
        MessageBox.Show(ex.ToString)
    End Try
End Sub

The above code works fine and shows me connected

However when I add this piece of code

        SQLquery = "SELECT id FROM user where username=John Doe"
        da = New SqlCeDataAdapter(SQLquery, con)
        da = New SqlCeDataAdapter(SQLquery, con)
        da.Fill(ds, "db1")

It gives me this exception error:-
enter image description here

What does it mean? how to get the userid of that particular person?

Also if i just put the insert query in SQLquery, will it work? As i have been doing this by watching few video tutorials, but further they don’t have tutorials on this, also my book does not explains anything about Compact databases and as i am so far with this application dont want to switch…

  • 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-12T00:28:26+00:00Added an answer on June 12, 2026 at 12:28 am

    Put your username between single quotes and user is a reserved word in Sql Compact.
    You need to enclose it in square brackets

    SQLquery = "SELECT id FROM [user] where username='John Doe'" 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a new ActionFilter for an ASP.NET MVC application that I'm creating.
I am thinking about creating my new asp.net mvc web application compatible with native
I'm creating new Site Definitions using this method: http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx and when they get created,
Using .NET and the Word Interop I am programmatically creating a new Word doc
I've got an ASP.Net application which manages the IIS server as follows: Successfully using
I've got an ASP.NET application that uses the CreateUserWizard to register new users. Part
I am developing an ASP.Net application that will need to verify that the user
I'm creating a VB.Net application that stores data in a SQLite backend. The data
I have made a MVC application that uses the built-in ASP.NET login functions. It
I am creating a ASP.NET (VB.NET) application that must retrieve a known remote file

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.