Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Response.write Paramatised Sql

Started 1 month, 1 week ago by cookie_powered
Hi Guys, this may be a stupid/simple answer but im stumped I have a paramatized sql string like the following example Dim strUpdate As String Dim cmdUpdate As SqlCommand strUpdate = "UPDATE test_tbl SET Name = @Name WHERE eUID = @eUID" cmdUpdate = New SqlCommand(strUpdate, sqlConn) cmdUpdate.Parameters.AddWithValue("@Name", “bill...
Site: Forums - ASP.NET Forums  Forums - ASP.NET Forums - site profile
Forum: Data Access and ObjectDataSource Control  Data Access and ObjectDataSource Control - forum profile
Total authors: 4 authors
Total thread posts: 6 posts
Thread activity: no new posts during last week
Domain info for: asp.net

Other posts in this thread:

vipuldonga replied 1 month, 1 week ago
hi, i think you can't write on the screen "strUpdate" string with parameter because they fill internally so when erver you print "strUpdate" thye only print you orignaly string.

cookie_powered replied 1 month, 1 week ago
Hi vipuldonga, thanks for replying, i agree with what you are saying, but at some point the paramatised query has to be passed over to sql as an sql string containing bill and 1, i somehow need to capture it and this point?

sanjeev87 replied 1 month, 1 week ago
Dim strUpdate As String Dim cmdUpdate As SqlCommand strUpdate = "UPDATE test_tbl SET Name = "&Name&" WHERE eUID = "&eUID&" cmdUpdate = New SqlCommand(strUpdate, sqlConn) you do not need these two lines cmdUpdate.Parameters.AddWithValue("@Name", “bill”) cmdUpdate.Parameters.AddWithValue("@eUID", “1”)...

cookie_powered replied 1 month, 1 week ago
Hi sanjeev, I could but this would leave it more open to sql injection if i used non paramatised.

Wencui Qian - MSFT replied 1 month, 1 week ago
Hi cookie_powered, As I know, you may not get the final query from a sqlcommand object. You can also debug the application and check the sqlcommand object. To get the expected result, I guess you may have to do it manually which I mean you can do it like this: 1) Display the default sql query. 2) Loop through the parameter collection and display the parameter values....

 

Top contributing authors

Name
Posts
cookie_powered
3
user's latest post:
Response.write Paramatised Sql
Published (2009-11-11 06:25:00)
 Hi sanjeev,   I could but this would leave it more open to sql injection if i used non paramatised.    
vipuldonga
1
user's latest post:
Response.write Paramatised Sql
Published (2009-11-11 06:08:00)
hi, i think you can't write on the screen "strUpdate" string with parameter because they fill internally so when erver you print "strUpdate" thye only print you orignaly string.
sanjeev87
1
user's latest post:
Response.write Paramatised Sql
Published (2009-11-11 06:18:00)
            Dim strUpdate As String             Dim cmdUpdate As SqlCommand             strUpdate = "UPDATE test_tbl SET Name =...
Wencui Qian - MSFT
1
user's latest post:
Response.write Paramatised Sql
Published (2009-11-13 01:10:00)
Hi cookie_powered, As I know, you may not get the final query from a sqlcommand object. You can also debug the application and check the sqlcommand object. To get the expected result, I guess you may have to do it manually which I mean you can do it like this: 1) Display the default sql query. 2) Loop through the parameter collection and display the parameter values....

Related threads on "Forums - ASP.NET Forums":

Related threads on other sites:

Thread profile page for "Response.write Paramatised Sql" on http://www.asp.net. This report page is a snippet summary view from a single thread "Response.write Paramatised Sql", located on the Message Board at http://www.asp.net. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity