One option is to split the original string at the location of
?
and reconstruct using
@param
as shown below
Sub Main
Dim statement As String = "INSERT INTO X (a,b,c) values (?,?,?)"
Dim statements As String() = statement.Split("?"C)
Dim sb As New StringBuilder()
For i As Integer = 0 To statements.Length - 2
sb.AppendFormat("{0}@param{1}", statements(i), i + 1)
Next
sb.Append(statements(statements.Length - 1))
Dim modifiedStatement As String = sb.ToString()
Console.WriteLine(modifiedStatement)
End Sub