Link to home
Start Free TrialLog in
Avatar of mattibutt
mattibuttFlag for United States of America

asked on

DataTableAdapter Related Problem

hi guys
i have web application recently i want to add a new column in the database but i am having problem at front end of my application i have updated all the relevant procedures but it doesnt let me add a new column for updating and inserting i have attached the code below.
try
        {
            VideoItemsTableAdapter da = new VideoItemsTableAdapter();
            string _name = name.Text;
            int _gameid = Convert.ToInt32(((DropDownList)gameid.Controls[0]).SelectedValue);
 // adding this following new field
           int _gameidtwo = Convert.ToInt32(((DropDownList)gameidtwo.Controls[0]).SelectedValue);
            int _storyid = Convert.ToInt32(((DropDownList)storyid.Controls[0]).SelectedValue);
            DateTime _expirydate = Convert.ToDateTime(expirydate.Text);
            byte _rating = Convert.ToByte(((DropDownList)rating.Controls[0]).SelectedValue);
            DateTime _length = Helper.FormatVideoLength(length.Text);
            string _videofilename = videofilename.Text;
            byte _cretificate = Convert.ToByte(certificate.Checked ? 1 : 0);
           
           // _gameidtwo
               // [GameIDtwo] @GameIDtwo
            try // trying to update old data
            {
                int RowID = Convert.ToInt32(Request.QueryString["RowID"].ToString());
                da.Update(1, _name, _gameid, _gameidtwo,   _storyid, _expirydate, _rating, null, _length, _videofilename, _cretificate, null, null, null, null, Convert.ToInt32(Session["UserID"].ToString()), RowID, RowID);
                SavingRepeaterItems(keywordsTableControlRepeater, RowID);
            }
            catch (Exception exNewData) // saving new data
            {
                try
                {
                    da.Insert(1, _name, _gameid, _gameidtwo, _storyid, _expirydate, _rating, null, _length, _videofilename, _cretificate, null, null, null, null, Convert.ToInt32(Session["UserID"].ToString()));
                    SavingRepeaterItems(keywordsTableControlRepeater, 0);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mattibutt

ASKER

ok