בעיה בכתיבה לDATABASE

  • פותח הנושא l911
  • פורסם בתאריך

l911

New member
בעיה בכתיבה לDATABASE

שלום לכולם אני נתקלתי בבעיה למרות שאני מנסה להכניס ערך לתוך שדה ברשומה הACCSSESS לא מעדכן את הערך ברשומה זו.כמו כן איך מעדכנים רשומה מסויימת? כלומר איך אני מעדכן רשומה עם שם מסויים תודה l911
int intval4; String playerID=this.Session ["playerID"].ToString (); //fill DataTable in a DataSet with data from a data source using a DataAdapter. this.oleDbConnection1 .Open (); this.oleDbDataAdapter1 .Fill (this.advertisingDs1 ); this.oleDbConnection1 .Close (); //Change the data in individual DataTable objects by , updating DataRow objects DataRow adverdeside= this.advertisingDs1.Tables [0].NewRow () ; intval4=int.Parse (ListBox_tv .SelectedItem .Value );//Converting String to int adverdeside ["t_v_days"]=intval4 ;// כתיבת הערכים שנבחרו לבסיס הנתונים intval4=int.Parse (ListBox_internet.SelectedItem .Value );//Converting String to int adverdeside ["internet_days"]=intval4 ;// כתיבת הערכים שנבחרו לבסיס הנתונים intval4=int.Parse (ListBox_paper.SelectedItem .Value );//Converting String to int adverdeside ["paper_days"]=intval4 ;// כתיבת הערכים שנבחרו לבסיס הנתונים intval4=int.Parse (ListBox_radio.SelectedItem .Value);//Converting String to int adverdeside ["radio_days"]=intval4 ;// כתיבת הערכים שנבחרו לבסיס הנתונים adverdeside ["player_ID"]="o";//this.Session ["playerID"].ToString(); for (int i=0;i<this.advertisingDs1 .Tables [0].Rows .Count ;i++) { if (this.Session ["playerID"].ToString ()==this.advertisingDs1 .Tables [0].Rows ["player_ID"].ToString ()) { this.advertisingDs1 .Tables [0].Rows .RemoveAt (i); //this.advertisingDs1 .Tables [0].Rows.InsertAt (adverdeside,i); } } this.oleDbConnection1 .Open (); this.oleDbDataAdapter1 .Update (advertisingDs1); this.oleDbConnection1 .Close (); //Response.Redirect ("ControlPage.aspx"); }
 
למעלה