Click here to Skip to main content
15,920,648 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
hi,am new to this coding field,
i hav a problem with saving the data in the database,

i hav used the gridbouondcolumn which is a ajaxtool n in that i hav used a numerical up down control so that an employee can fill his rating for modules, after filling all the ratings i hav to save the rating in database by clicking the save button, am not able to write proper code for it,
please help me ....
Posted
Comments
R. Giskard Reventlov 16-Jun-10 3:43am    
Reason for my vote of 1
1 for using txtspk.
R. Giskard Reventlov 16-Jun-10 3:43am    
What have you already tried?
bharathrashmi 17-Jun-10 6:01am    
protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{


SqlConnection DBConn = new SqlConnection("user id=sa;password=rebbecca;database=SkillMatrix;datasourse=EMPSkillCompetencyLevel");
SqlCommand DBCmd = new SqlCommand();
SqlDataAdapter DBAdap = new SqlDataAdapter();
DataSet DS = new DataSet();
DBConn.Open();


try {

//Add Insert Statement

DBCmd = new SqlCommand("INSERT INTO EMPSkillCompetencyLevel(empid, Skillid, Moduleid,ModuleLevel) VALUES (@empid, @Skillid, @Moduleid, @ModuleLevel)", DBConn);


//Add Database Parameters
DBCmd= new SqlDataAdapter("
int temp1;
temp1 = 2;

DBCmd.Parameters.Add("@ModuleLevel", SqlDbType.Int).Value = temp1;


DBCmd.ExecuteNonQuery();
Response.Write("Your Record is Updated ");



DBAdap = new SqlDataAdapter("SELECT * FROM EMPSkillCompetencyLevel", DBConn);






}
catch (Exception exp)
{

Response.Write(exp);

}



DBCmd.Dispose();
DBAdap.Dispose();
DBConn.Close();
DBConn = null;

}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900