简体   繁体   English

自动检索文本框中的数据

[英]Auto retrieval of data in textbox

I have a log in page shown below 我有一个如下所示的登录页面 管理员登录页面

Admin only has a permission to access this page and he creates a new user with the following requirements. 管理员仅具有访问此页面的权限,并且他创建具有以下要求的新用户。

when the particular user login his page is shown below 当特定用户登录其页面时,如下所示

用户登录页面

I need to retrieve the Faculty id,so that it should me automatically displayed in the textbox. 我需要检索学院ID,以便它应该自动显示在文本框中。

for that i need to call from datbase.? 为此,我需要从datbase打电话。 or is there any text box property to display the data ? 还是有任何文本框属性可显示数据?

I am using asp.net withc# 我正在使用asp.net和c#

SqlConnection Conn = new SqlConnection(Connection_String);
SqlCommand Comm1 = new SqlCommand(Command, Conn);
Conn.Open();
textBox.Text = Comm1.ExecuteScalar();
Conn.Close();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM