Results 1 to 2 of 2

Thread: Interrogating a database using sql string

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    9

    Interrogating a database using sql string

    I'm trying to interrogate a database to display on a Datagrid. I am using a simple sql string to do this but am having problems.

    The string I'm using is along the lines of

    SELECT Database.Column1 AS ["Name1"], ... FROM Database

    The trouble is one of the columns in the database is called "Section". When I try to use this is gives me an error:

    SELECT Database.Column1 AS ["Name1"], Database.Section, ... FROM Database

    If I rename the column it works. Trouble is I can't do this as the database is already in use by customers...

    Please help!

    (addition: I have just upgraded this code from vb6 where it worked fine to .net 1.1 )

  2. #2
    Fanatic Member
    Join Date
    Feb 2007
    Location
    Eindhoven
    Posts
    828

    Re: Interrogating a database using sql string

    Use brackets around the Table Name

    vb Code:
    1. Select Database.[Section] From Database

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width