linq to sql - TextBox value not updated -


i fetching data database textbox using linq.when try update same textbox value,it not work.

dal.tournamentsdatacontext tdc = new schoolsports.dal.tournamentsdatacontext();         var tournamenttable = tdc.gettable<dal.tournament>();         var tournamentrecord = (from rec in tournamenttable                                 rec.tournamentid == tournamentid                                 select rec).single();                     tournamentrecord.tournament_type = tournament_type;         tournamentrecord.tournament_name = tournament_name; ;         tournamentrecord.tournament_level = tournament_level;         tournamentrecord.tournament_for = tournament_for;         tournamentrecord.country_code = country_code;         tournamentrecord.tournament_status = tournament_status;         tournamentrecord.tournament_begin_date = tournament_begin_date;         tournamentrecord.tournament_end_date = tournament_end_date;         tournamentrecord.sponsored_by = sponsored_by;         tournamentrecord.tournament_details = tournament_details;          var organisertable = tdc.gettable<dal.organiser>();         var organiserrecord = (from rec in organisertable                                rec.tournament_id == tournamentid                                select rec).single();             organiserrecord.name_of_organiser = orname;         organiserrecord.telephone = orteleno;         organiserrecord.email = oremail;         organiserrecord.mobile = ormobile;         organiserrecord.fax = orfax;          if (tournament_for == "school")         {              var invitedschoolidtable = tdc.gettable<dal.invited_school>();             var invitedschoolidrecord = (from rec in invitedschoolidtable                                          rec.tournament_id == tournamentid                                          select rec).single();             invitedschoolidrecord.school_ids = schooluniids;          }         if (tournament_for == "university")         {              var inviteduniversitytable = tdc.gettable<dal.invited_university>();             var inviteduniversityidrecord = (from rec in inviteduniversitytable                                              rec.tournament_id == tournamentid                                              select rec).single();             inviteduniversityidrecord.university_ids = schooluniids;          }         tdc.submitchanges(); 

(the following answer written before updated question)

if want value updated value in text box, text box must bound datasource


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -