Fill a Dataset

I am trying to start using ADO.Net but I can't even fill a dataset.  I am getting an error "Incorrect Syntax near User" using the following code:

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Imports System.Data.SqlClient
Imports System.Windows.Forms

Module Module1

    Sub Main()
        Dim cmdUser As SqlCommand
        Dim da As New SqlDataAdapter
        Dim conn As New SqlConnection
        Dim ds As New DataSet

        Try
            ' Configure the Connection
            conn.ConnectionString = "Data Source=(Local)\SQLExpress;Initial Catalog=BTBRepIT;Integrated Security=True;Pooling=False"

            ' Configure the Command
            cmdUser = conn.CreateCommand
            cmdUser.CommandText = "Select * From User"
            cmdUser.CommandType = CommandType.Text
            da.SelectCommand = cmdUser

            ' Fill the Dataset
            da.Fill(ds)

            MessageBox.Show("Completed Successfully")
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
    End Sub

End Module

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I know the problem isn't the SQL statement since they don't get much simpler than that but as far as what the actual problem is I have no idea.  Thank you in advance for your help.
LVL 3
kmcbreartyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bchoorCommented:
try this

"SELECT * FROM [User]"

or

"SELECT * FROM ""User"""

HTH
~BC
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bchoorCommented:
BTW, USER is a reserved word for sql - so that's why you may be having that problem.
0
kmcbreartyAuthor Commented:
Thank you,  that was the problem.  I usually precede my tables with tbl to aviod naming conflicts but was just creating a test to verify I was doing it correctly.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.