TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
foo foolios
NA
8
0
Trying to update a value in the database. Asp.Net/C#/SQL/VS2005
Oct 4 2007 8:12 PM
I don't really know how to check why it's not working.
I have a try/catch that tells me in the catch that it didn't succeed but not sure how to really know what's going on with it.
Here's my update attempt:
SqlCommand comm = new SqlCommand("UPDATE inventoryTbl SET categoryID = '@category' WHERE id = '@ID'", conn);
comm.Parameters.Add("@category", System.Data.SqlDbType.SmallInt);
comm.Parameters["@category"].Value = txtbx_itemCategory.Text;
try
{
// Execute the command
comm.ExecuteNonQuery();
// Reload page if the query executed successfully
//Response.Redirect("addrelatives.aspx");
}
catch
{
// Display error message
bttnApplyChanges.Text = "Error";
}
finally
{
// Close the connection
conn.Close();
}
Reply
Answers (
2
)
Does events in global file will execute very time when my page loaded
New Controls in .Net 3. 0