如何使用Ef将信息插入数据库 [英] How Do I Insert Information To Database Using Ef

查看:224
本文介绍了如何使用Ef将信息插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用实体框架将用户信息插入数据库。我正在使用CreateUserWizard.And此控件的事件如下。

i want to insert users information to database using entity framework. i' am using CreateUserWizard.And event of this control as follow.

protected void RegisterUser_CreatedUser(object sender, EventArgs e)
        {
            Database1Entities db = new Database1Entities();
            Kullanıcılar kullanıcı = new Kullanıcılar();
            kullanıcı.AdSoyad = RegisterUser.UserName;
            kullanıcı.Şifre = RegisterUser.Password;
            db.Kullanıcılar.Add(kullanıcı);

            db.SaveChanges();


            FormsAuthentication.SetAuthCookie(RegisterUser.UserName, createPersistentCookie: false);

            string continueUrl = RegisterUser.ContinueDestinationPageUrl;
            if (!OpenAuth.IsLocalUrl(continueUrl))
            {
                continueUrl = "~/";
            }
            Response.Redirect(continueUrl);

           
            }





但当我检查实体以查看用户信息时,我看到空白列.how可以解决这个问题吗?



but when i check the Entity to see user information i see blank columns.how can solve this problem?

推荐答案

这篇关于如何使用Ef将信息插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆