Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all.
I'm trying to retrieve the actual SQL-query string from a
SqlClient.SqlCommand object. I have executed something along these lines:
db = new System.Data.SqlClient.SqlConnection(DB_CONNECTION);
db.Open();
sql = "INSERT INTO foo (foo1, foo2) VALUES (@foo1, @foo2)";
cmd = new System.Data.SqlClient.SqlCommand(sql, this.db);
cmd.Parameters.Add("@foo1, "value1");
cmd.Parameters.Add("@foo2, "value2");
And now I want to see the precise sql statement that is going to be
passed when I execute cmd.ExecuteNonQuery(). Is this possible?
Thankyou
Mads Ravn
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.