(You are safe-guarded, so that if you perform an update operation from your function, you will get caught.) A word of warning though: data access from scalar UDFs can often give performance problems.
You cannot pass the list as a alien shooter 3 game for windows 7 parameter to sp_executesql, so you would have to use exec and be open to SQL injection.
You can even search the column finition using SQL.
If you just go ahead, your code can become very messy, and be difficult to read, troubleshoot and maintain.Exec exec takes one parameter which is an SQL statement to execute.The remedy is to test the entire chain or path of objects one at a time: If (myFoo IsNot Nothing) AndAlso (r IsNot Nothing) AndAlso (ems IsNot Nothing) Then.The solution is the same, but not as obvious.This can be done in Sub New as long as your code is after the InitializeComponent call: ' Module level declaration Private NameBoxes as TextBox Private studentName As String ' Form Load, Form Shown or Sub New: ' ' Using the OP's approach (illegal using.Since user1.Orders could appear on the scene at any time, user1 cannot share cache entry with a user different default schema.ExecuteReader If ad Then lblFirstName.Remedy Replace Exit Function in the function with Return bList.Text, expiry) Then '.In this case, the arguments for using stored procedures for encapsulation may not be equally compelling.The first point is mainly a safeguard, so that if there is a injection hole, the intruder will not be able to do that much harm.This is followed by a section where I discuss why we use stored procedures, and how that is affected by the use of dynamic SQL.