Results 1 to 9 of 9

Thread: VBNET2008 SQLSERVER 2000 SQL string

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Location
    New Zealand
    Posts
    207

    VBNET2008 SQLSERVER 2000 SQL string

    Hullo Good Guys,
    I need your help. Please help me.

    I am using VBNET2008 and SQL SERVER 2000.
    I tried to create this SQL string to retrieve CustomerID and a CustomerID and Name together but it's not working

    Here are the SQL String that is not working.
    Dim strsql As String = ""
    strsql &= "Select CustomerID, "
    strsql &= " ( CustomerID & " - " & CompanyName ) as [Companyname]"
    strsql &= " From TestCustomers Order by CompanyName"

    This is the error message
    Conversion from string "Select CustomerID, CustomerID & " to type 'Double' is not valid.

    Cause by this SQL String coding:
    strsql &= " CustomerID & " - " & CompanyName as [Companyname]"

    I am using the NORTHWIND DatacBase in SQL SERVER 2000 and the table is Customers
    Last edited by Lennie; Jan 11th, 2011 at 06:17 PM. Reason: type error

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