|
-
Proper syntax to retrieve field from SQL table?
In Code Behind, What is proper select statement syntax to retrieve the @BName field from a table?
Using Visual Studio 2003
SQL Server DB
I created the following parameter:
Dim strName As String
Dim parameterBName As SqlParameter = New SqlParameter("@BName", SqlDbType.VarChar, 50)
parameterBName.Value = strName
myCommand.Parameters.Add(parameterBName)
I tried the following but get error:
Dim strSql As String = "select @BName from Borrower where BName= DOROTHY V FOWLER "
error is:
Line 1: Incorrect syntax near 'V'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'V'.
Source Error:
Line 59:
Line 60:
Line 61: myCommand.ExecuteNonQuery() 'Execute the query
Similar Threads
-
Replies: 17
Last Post: 04-04-2003, 04:55 PM
-
Replies: 2
Last Post: 08-07-2002, 02:20 PM
-
By Roy in forum VB Classic
Replies: 3
Last Post: 12-04-2001, 02:39 AM
-
By bogus in forum Database
Replies: 1
Last Post: 03-22-2001, 08:26 AM
-
By Julian Pickard in forum VB Classic
Replies: 1
Last Post: 02-09-2001, 08:42 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks