I want to programatically insert and updaet the small window application attached herewith. I tried to do but didnt workout.View is properly working. code http://rapidshare.com/files/353391227/WindowsApplication4.rar.html Can anyone pls write the code for insert and update? Thanks for helping
Here is the sample code for updating.. protected void grvVideos_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { GridViewRow row = grvVideos.Rows[e.RowIndex]; if (row != null) { Label lblID = (Label)row.FindControl("lblID"); TextBox txtTitle = (TextBox)row.FindControl("txtNewTitle"); TextBox txtSubTitle = (TextBox)row.FindControl("txtNewSubTitle"); TextBox txtDescription = (TextBox)row.FindControl("txtNewDescription"); TextBox txtFileName = (TextBox)row.FindControl("txtNewFileName"); TextBox txtLink1 = (TextBox)row.FindControl("txtNewLink1"); TextBox txtLink2 = (TextBox)row.FindControl("txtNewLink2"); int id = int.Parse(lblID.Text.Trim()); string title = txtTitle.Text.Trim().Replace("'", "''"); string subtitle = txtSubTitle.Text.Trim().Replace("'", "''"); string description = txtDescription.Text.Trim().Replace("'","''"); string filename = txtFileName.Text.Trim(); string link1 = txtLink1.Text.Trim(); string link2 = txtLink2.Text.Trim(); Videos oVideos = new Videos(); bool VideoChanged = oVideos.UpdateVideos(id, title, subtitle, description, filename, link1, link2); if (VideoChanged == true) { grvVideos.EditIndex = -1; GetData(); } } }