如何通过将主键作为输入从SSMS表中获取数据并应显示在屏幕上 [英] How to fetch data from a SSMS table by taking primary key as input and should display on the screen
问题描述
目标:需要以Emp_ID作为输入来获取屏幕上的员工详细信息。
有谁可以帮助我吗?
1)我应该为该表创建一个EF模型。
2)我应该编写一个存储过程来获取主键为Emp_ID的数据。 />
3)我们有一个表EmpDetails如下
表EmpDetails:
Emp_ID(pk)F_Name L_Name Email_ID Mobile_Num
123456 Sunil Kumar sunil.Kumar@wipro.com 1111111111
222222 Ravi Teja ravi.teja@wipro.com 2222222222
333333 Pavan Kumar pavan.kumar@wipro.com 3333333333
444444 Arun Kumar arun.kumar@wipro.com 4444444444
4)我需要创建一个类似的屏幕
浏览器屏幕:
Emp_ID:______ GetDetails(按钮) )
F_Nam e:______
L_Name:______
Email_ID:______
Mobile_Num:______
在上面的屏幕中,当用户提供Emp_ID并单击GetDetails按钮时,该员工的所有详细信息应填充在变量的相应文本框中的屏幕上。
我尝试过的事情:
我创建了Table和EF但是不知道更进一步步骤
Aim: need to fetch the employee details on the screen by taking Emp_ID as an input.
Can anyone please help me in this?
1) i should create an EF model for that table.
2) i should write a stored procedure for fetching data with the primary key Emp_ID.
3) we have a Table EmpDetails like below
Table EmpDetails:
Emp_ID(pk) F_Name L_Name Email_ID Mobile_Num
123456 Sunil Kumar sunil.Kumar@wipro.com 1111111111
222222 Ravi Teja ravi.teja@wipro.com 2222222222
333333 Pavan Kumar pavan.kumar@wipro.com 3333333333
444444 Arun Kumar arun.kumar@wipro.com 4444444444
4) i need to create a screen like
Browser Screen:
Emp_ID : ______ GetDetails(button)
F_Name : ______
L_Name : ______
Email_ID : ______
Mobile_Num : ______
In the above screen when user gives an Emp_ID and clicks the GetDetails button then all the details of that employee should populate on the screen in the respective text boxes of the variables.
What I have tried:
I have created Table and EF but dont know the further steps
推荐答案
您需要先学习基本知识并了解其中的工作方式,尤其是请求
和响应
在无状态的web世界中的东西。
如果你是ASP.NET MVC的新手,我会建议您参考我的系列文章: ASP。 NET MVC 5:构建您的第一个Web应用程序 - 第1部分 [ ^ ]
您还可以访问官方文档来学习ASP.NET MVC: Learn | ASP.NET站点 [ ^ ]
You need to start learning the basic first and know how stuff works, especially therequest
andresponse
thing in the stateless world of web.
If you are new to ASP.NET MVC, I'd recommend you to refer my series of article here: ASP.NET MVC 5: Building Your First Web Application - Part 1[^]
You can also head over to the official docs to learn ASP.NET MVC: Learn | The ASP.NET Site[^]
这篇关于如何通过将主键作为输入从SSMS表中获取数据并应显示在屏幕上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!