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
Henrik Mikkelsen
NA
3
4.2k
Gridview Updating Problem
Mar 19 2013 5:45 PM
Heey all, im having a little problem with my gridveiw updating command, i have tryed almost every thing knownen to me
all it have to do is update text and "imagepath and imagename"
and i have chected the spelling of the database names
Hope someone can help me
string connection = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(connection);
SqlCommand mySqlUpdate = new SqlCommand("UPDATE sv_Employee SET EmployeeName = @EmployeeName, EmployeeImage = @EmployeeImage WHERE EmployeeID = @EmployeeID", conn);
mySqlUpdate.CommandType = CommandType.Text;
mySqlUpdate.Parameters.Add("@EmployeeID", SqlDbType.Int).Value = Convert.ToInt32(lblEmployeeID.Text);
mySqlUpdate.Parameters.Add("@EmployeeName", SqlDbType.NVarChar).Value = txtEmployeeName.Text;
mySqlUpdate.Parameters.AddWithValue("@EmployeeImage", (imgPicture.ImageUrl == null ? (object)DBNull.Value : (object)imgPicture.ImageUrl));
try
{
conn.Open();
mySqlUpdate.ExecuteNonQuery();
}
finally
{
conn.Close();
}
Reply
Answers (
1
)
Asp.net Using C# codings
how to checked all the cheboxes in grideview using javascrip