Es handelt sich hierbei um asp.net
Code:
public bool Update(group_Options Option)
{
try
{
//create a SqlConnection to the DB
SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Datenbank"].ConnectionString);
//create a SqlCommand with the query tables to group_options table
SqlCommand cmd = new SqlCommand("UPDATE group_options SET optionsID" + Option.ID + " = @optionid WHERE groupid = @groupid", con);
//add the parameter 'optionid'
cmd.Parameters.AddWithValue("@optionid", Option.value);
//add the parameter 'groupid'
cmd.Parameters.AddWithValue("@groupid", Option.groupID);
//Open the SqlConnection
con.Open();
//check whether the SqlConnection is Open
if (con.State == System.Data.ConnectionState.Open)
{
cmd.ExecuteNonQuery();
}
//Close the SqlConnection
con.Close();
return true;
}
catch
{
return false;
}
}
Code:
public class group_Options
{
public int groupID { get; set; }
public int ID { get; set; }
public string value { get; set; }
public string name { get; set; }
public string description { get; set; }
public string type { get; set; }
}






