Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Database
Database General Discussion
Using a textbox as a variable
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="levyuk" data-source="post: 1654" data-attributes="member: 114"><p>Hi</p><p>I have this code</p><p>[CODE]</p><p>cmdSelect = New OleDbCommand( "SELECT [recipes].[ID], [recipes].[Name] FROM [recipes] WHERE Name LIKE 'a%'", conNorthwind )</p><p>[/CODE]</p><p></p><p>What I would like to do is change the LIKE part so that the variable to search by is equal to some text from a textbox e.g. </p><p></p><p>cmdSelect = New OleDbCommand( "SELECT [recipes].[ID], [recipes].[Name] FROM [recipes] WHERE Name LIKE '" & TextBoxName.Text "%'", conNorthwind )</p><p></p><p>Does anyone know how to do this?</p></blockquote><p></p>
[QUOTE="levyuk, post: 1654, member: 114"] Hi I have this code [CODE] cmdSelect = New OleDbCommand( "SELECT [recipes].[ID], [recipes].[Name] FROM [recipes] WHERE Name LIKE 'a%'", conNorthwind ) [/CODE] What I would like to do is change the LIKE part so that the variable to search by is equal to some text from a textbox e.g. cmdSelect = New OleDbCommand( "SELECT [recipes].[ID], [recipes].[Name] FROM [recipes] WHERE Name LIKE '" & TextBoxName.Text "%'", conNorthwind ) Does anyone know how to do this? [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Database
Database General Discussion
Using a textbox as a variable
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom