This simple function can be used to get value from exactly one field one record query result
How to use it:
Variable 'username' would be filled with the value of field username as a result from that query.
Read field from Database
Using the above function is simply:
Simple Function to read from Database and return as DataTable
This simple function will execute the specified Select SQL command and return the result as data set.
Now you can execute the above function from below codes
The above example expects that your SQL Express instance "SQLEXPRESS" is currently installed on "MYDEVPC" and your database "MyDatabase" contains "Customers", "Suppliers" and "Employees" tables and the "sa" user password is "pwd22". Please change these values as per your setup to get the desired results.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0