faqts : Computers : Databases : Microsoft SQL Server

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 9 people (44%) answered Yes
Recently 4 of 9 people (44%) answered Yes

Entry

Database: SQL: Dynamic: Simple: Visual Studio: ASP.NET: How to create a variable query via text box?

Dec 31st, 2003 16:01
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 01 January 2004 - 00:52 am --------------------
Database: SQL: Dynamic: Simple: Visual Studio: ASP.NET: How to create 
a variable query via text box?
---
Method: string concatenation
---
Steps: Overview:
 1. -Start a new Microsoft Visual Studio application
 2. -Put a text box on the form
 3. -Put a button on the form
 4. -Double click on the button
     1. Fill in the following source code
         mySqlS = "SELECT * FROM <my table name> WHERE <my column 
name> = " & TextBox1.Text
         ...
         other code to connect to the database and run this query
         ...
 5. -If you then run the program
     1. and fill in search text in the text box
        (e.g.
          John
        )
        then given that this can be found in your
        database table, the found results will be shown.
---
---
Internet: see also:
---
Database: Microsoft SQL server: SQL: Operation: Overview:Can you give 
an overview of SQL operations?
http://www.faqts.com/knowledge_base/view.phtml/aid/27560/fid/147
----------------------------------------------------------------------