在Visual C#中使用linq到sql类从数据库中获取数据 [英] Fetching data from Database using linq to sql classes in visual c#

查看:107
本文介绍了在Visual C#中使用linq到sql类从数据库中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

当我单击登录按钮时,我想转到下一页,如果用户名和密码错误,则它将保留在同一页面,在asp.net中使用Visual C#和linq to sql类.

i want when i click the login button it will go to next page,,and if the username and password is wrong then it will remain the same page,,in asp.net using visual c# and linq to sql classes..

这是查询...现在进一步告诉我什么是Visual C#代码.

this is the query...now tell me further what will be the Visual C# code.

   UsaAMSDBDataContext usaamms =新的UsaAMSDBDataContext();

           var login =来自usaamms中的admin.Admin_Logins
             b ;        
          其中admin.Name == txtUserName.Text&& admin.Password == Convert.ToInt16(txtPassword.Text)

         &bsp; ;       选择管理员;

    UsaAMSDBDataContext usaamms = new UsaAMSDBDataContext();
           
            var login = from admin in usaamms.Admin_Logins
                             
            where admin.Name == txtUserName.Text && admin.Password ==Convert.ToInt16( txtPassword.Text)

                        select admin;

..............告诉我C#代码....这将验证条件

....................Tell Me the C# Code....which will verify the conditons

请帮助我..

推荐答案

请帮助我..


这篇关于在Visual C#中使用linq到sql类从数据库中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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