Hi All; I'm writing a small app that is displaying information in a datagridview from a FoxPro table. I am having issues on the update side of things. I am trying to write my own update statements using the ODBCCommand object, and parameters. However, the statement is failing, with only the message of Syntax Error. When I try to get the actual command text, it shows the sql statement with the @VarName placeholders. Is there anyway to get the final sql statement? Or should it show as the command text, and I am setting this up wrong. Here is what I am doing: sql = "UPDATE table1 SET Descript = @Desc " sql += "WHERE RefNum = @RefNum " cmd.CommandText = sql parm = New OdbcParameter("@desc", SqlDbType.Char, 120) parm.Value = oRow.Item("description").ToString().Trim() cmd.Parameters.Add(parm) parm = New OdbcParameter("@refnum", SqlDbType.Char, 12) parm.Value = oRow.Item("ref num").ToString().Trim() cmd.Parameters.Add(parm) cmd.ExecuteNonQuery() 'This fails with Syntax Error
This is a shortened version, there are around 15 variables I am using. When I check the value of CommandText, it shows as: "UPDATE table1 sET Descript = @Desc WHERE RefNum = @RefNum" I am guessing this is what it should show, but is there anyway to see what is actually being sent to execute? Thanks