View Single Post
Old May 18th, 2004, 03:55 PM
bmains bmains is offline
Friend of Wrox
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


Sure you can dynamically build a command. It sounds like you're creating dynamic SQL though; so none of the SQL queries can be predefined in advanced? If not, you can use string manipulation or regular expressions to parse apart the SQL string.

strSQL = strSQL.Substring(0, strSQL.indexOf(" WHERE "))


' \. means any characters, and the + means one or more
strSQL = Regex.Replace(strSQL, " WHERE \.+", "")

Something like that,