How many times you wish you can construct strings not using the " (quote) and + (plus).

In our day to day programming, we usually do stuff like:

Sub Query(table_name As String, idx As Integer)
  Dim sql As String = "SELECT * FROM " + table_name + "WHERE PKID=" + idx.ToString()
EndSub

Or maybe you can use "string.format" or StringBuilder

Dim sql As String = String.Format("SELECT * FROM {0} WHERE PKID={1}", table_name, idx)

Or

Dim sql As New StringBuilder
sql.Append("SELECT * FROM ").Append(table_name).Append(" WHERE PKID=").Append(idx.ToString())

As you can see, you can't get away from using the " and + sign. angry.jpeg

Fortunately, there is another way to write above code and you can only get in VB.NET, sorry C# guys...

Dim sql As String = <span>SELECT * FROM <%= table_name %> WHERE PKID=<%= idx.ToString() %>; <span>.Value

So elegant...

Try it out. Happy coding...