如何使用文本框中的用户名等于名称从表中提取UserID? [英] How to extract UserID from Table using User name equal name from textbox?

查看:90
本文介绍了如何使用文本框中的用户名等于名称从表中提取UserID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表中有用户ID和用户名.
从文本框中接受名称,然后在表中找到该名称,然后返回该名称的用户ID.如何在VB.net中编写代码?

There is user id and user name in the table.
Accept name from text box and find this name in table and return User id for this name.How to write code behind in VB.net?

推荐答案

Dim sqlco As New SqlConnection("")
Dim adp_temp As New SqlDataAdapter("select id from t where name ='" & TextBox1.Text & "'", sqlco)
Dim dt As New DataTable
adp_temp.Fill(dt)


这篇关于如何使用文本框中的用户名等于名称从表中提取UserID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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