日期:2014-05-20  浏览次数:20854 次

linq 不访问数据库但是可以读到数据很费解
C# code
 YZCXDataClassesDataContext Dll = new YZCXDataClassesDataContext();
        /// 向数据库添加相应的列
        /// </summary>
        /// <param name="ID">工号</param>
        /// <param name="Name">姓名</param>
        /// <param name="Lgname">登录名</param>
        /// <param name="Password">登录密码</param>
        /// <param name="Role">权限</param>
        /// <param name="Birth">生日</param>
        /// <param name="Rztime">入职时间</param>
        /// <param name="KS">隶属科室</param>
        /// <param name="Sex">性别</param>
        /// <param name="Rema">备注</param>
        public Boolean  ADuser()
        {
            Doctor dc = new Doctor();
            dc.ID = GetNameClass.NID1;
            dc.Name = GetNameClass.NName1;
            dc.LgName = GetNameClass.NLgName1;
            dc.PassWord = GetNameClass.Npassword1;
            dc.Role = GetNameClass.NProle1;
            dc.Birthday = GetNameClass.Nbirstday1;
            dc.RZTime = GetNameClass.Nrztime1;
            dc.KS = GetNameClass.Nks1;
            dc.Sex = GetNameClass.Nsex1;
            dc.Remark = GetNameClass.Nrem1;
            Dll.Doctor.InsertOnSubmit(dc);
            Dll.SubmitChanges();
         }


执行完操作,数据库没有任何反应,调试没有报错,一切运行正常,本人菜鸟,请多多指教

------解决方案--------------------
调试查看 Dll.Log
------解决方案--------------------
检查对应的配置文件中的连接字符串
------解决方案--------------------
C# code

Dll.Doctor.InsertOnSubmit(dc);