Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 20, 2011 01:21 PM by sneha24
Member
23 Points
17 Posts
Apr 19, 2011 11:40 PM|LINK
Hi All,
I have written the below code to update Touched field in TBL_TOP10 SQL Server table. the code is executing without any errors but its not updating the Touched field.
any help is appriciated. Thanks
UpdDBConn =
New SqlConnection("server=OWNER-PC\SQLHOME;Integrated Security=true;database=QACentral")
" Update TBL_TOP10 set touched = ""Touched"" where transaction_id = " & v_transaction_id
cmdUpdate.Connection = UpdDBConn
UpdDBConn.Open()
cmdUpdate.ExecuteNonQuery()
Star
8970 Points
1590 Posts
Apr 20, 2011 07:02 AM|LINK
Hi,
Please check if the table in database contains any record against the transaction_id, with which you are updating the table (in your where clause)
you can use select * from TBL_T0P10 where transaction_id = [your transaction id here with which you are updating]
if it returns no record, that means you table has no record to be updated against that transaction id.
--
Hope this helps..
454 Points
274 Posts
Apr 20, 2011 10:09 AM|LINK
sample ocde
SqlConnection sqlConnection = new SqlConnection(ur connection string);
string querystring2 = "UPDATE TourHeader set name='" + tourname + "', city='" + cities + "', description='" + description + "', tourcode='" + tourcode + "', images='"+ image +"' WHERE TourHeader.Id = '" + id + "'"; SqlCommand cmd = new SqlCommand(querystring2, sqlConnection); sqlConnection.Open(); cmd.ExecuteNonQuery(); sqlConnection.Close();
Apr 20, 2011 01:21 PM|LINK
tushartayalster sample ocde SqlConnection sqlConnection = new SqlConnection(ur connection string); string querystring2 = "UPDATE TourHeader set name='" + tourname + "', city='" + cities + "', description='" + description + "', tourcode='" + tourcode + "', images='"+ image +"' WHERE TourHeader.Id = '" + id + "'"; SqlCommand cmd = new SqlCommand(querystring2, sqlConnection); sqlConnection.Open(); cmd.ExecuteNonQuery(); sqlConnection.Close();
Thank You
sneha24
Member
23 Points
17 Posts
Problem with Update in ASP.NET
Apr 19, 2011 11:40 PM|LINK
Hi All,
I have written the below code to update Touched field in TBL_TOP10 SQL Server table. the code is executing without any errors but its not updating the Touched field.
any help is appriciated. Thanks
UpdDBConn =
New SqlConnection("server=OWNER-PC\SQLHOME;Integrated Security=true;database=QACentral")
" Update TBL_TOP10 set touched = ""Touched"" where transaction_id = " & v_transaction_id
cmdUpdate.Connection = UpdDBConn
UpdDBConn.Open()
cmdUpdate.ExecuteNonQuery()
cmdUpdate.CommandText =hassanmehmoo...
Star
8970 Points
1590 Posts
Re: Problem with Update in ASP.NET
Apr 20, 2011 07:02 AM|LINK
Hi,
Please check if the table in database contains any record against the transaction_id, with which you are updating the table (in your where clause)
you can use select * from TBL_T0P10 where transaction_id = [your transaction id here with which you are updating]
if it returns no record, that means you table has no record to be updated against that transaction id.
--
Hope this helps..
Mark as Answer, if it answers you..
--
tushartayals...
Member
454 Points
274 Posts
Re: Problem with Update in ASP.NET
Apr 20, 2011 10:09 AM|LINK
sample ocde
SqlConnection sqlConnection = new SqlConnection(ur connection string);
string querystring2 = "UPDATE TourHeader set name='" + tourname + "', city='" + cities + "', description='" + description + "', tourcode='" + tourcode + "', images='"+ image +"' WHERE TourHeader.Id = '" + id + "'"; SqlCommand cmd = new SqlCommand(querystring2, sqlConnection); sqlConnection.Open(); cmd.ExecuteNonQuery(); sqlConnection.Close();
Tushar Tayal
Remember to click “Mark as Answer” to the post that helps you.
sneha24
Member
23 Points
17 Posts
Re: Problem with Update in ASP.NET
Apr 20, 2011 01:21 PM|LINK
Thank You