示例#1
0
        private void SaveToDatabase()
        {
            try
            {
                VideoInfo.KinnectFilePath = SavingPath.Remove(0, app.FileUrl.Length);

                //VideoInfo.User_id = thisuser.User_id;
                VideoInfo.LeapKinnectType = LeapKinnectType.Kinnect;
                VideoInfo.word_id         = thisword.word_id;

                videoservice.Create(VideoInfo);
                MessageBox.Show("Saving Successed.");
            }
            catch (DbEntityValidationException ex)
            {
                StringBuilder sb = new StringBuilder();
                foreach (var sdc in ex.EntityValidationErrors)
                {
                    foreach (var ssd in sdc.ValidationErrors)
                    {
                        sb.Append(ssd.ErrorMessage);
                    }
                }
                MessageBox.Show(sb.ToString());
            }
        }