Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
Try:Using con As New SqlConnection(strConnect) con.Open() Using com As New SqlCommand("INSERT INTO myTable (myColumn1, myColumn2) VALUES (@C1, @C2)", con) com.Parameters.AddWithValue("@C1", myValueForColumn1) com.Parameters.AddWithValue("@C2",...
Try this way:Dim sql As String = "INSERT INTO myTable (myColumn1, myColumn2) VALUES (@C1, @C2)" Dim sql_to_log As String = sql sql_to_log = sql_to_log.Replace("@C1", myValueForColumn1.tostring) sql_to_log = sql_to_log.Replace("@C2", myValueForColumn2.tostring)Save...
there is no other solution !!?let me explain again,, I want to display the query string after execution when parameters have been used ,I hope you will get what do i mean