如何使用DAL和BLL从Databse向文本框写入值

编程入门 行业动态 更新时间:2024-10-28 21:27:17
本文介绍了如何使用DAL和BLL从Databse向文本框写入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想检查用户是否存在,如果存在,则应将用户密码检索到textbox2,我正在使用BLL检查用户是否存在.

Hi, I want to check whether user exists, if exists then user password should be retrieved to textbox2, I am using BLL to check whether user exists or not.

Protected Sub button1_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim productslogic As New productsBLL() Dim anil As DataSet1.asaaDataTable = productslogic.GetDataByname(TextBox1.Text) TextBox2.Attributes.Add("value", productslogic.GetDataByname(TextBox1.Text))

使用此代码时,出现以下错误:错误:无法将类型"DataSet1.asaaDataTable"的值转换为字符串".如果将其转换为字符串,则表示使用此代码:

When using this code, I am getting following error: ERROR:Value of type ''DataSet1.asaaDataTable'' cannot be converted to ''String''. If I am converting this to string then I am using this code:

Protected Sub button1_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim productslogic As New productsBLL() Dim anil As DataSet1.asaaDataTable = productslogic.GetDataByname(TextBox1.Text) TextBox2.Attributes.Add("value", productslogic.GetDataByname(TextBox1.Text).ToString)

这可以正常执行,但是在textbox2中,我得到了数据表名称:asaa(asaa是我的数据表),但是我希望用户密码进入文本框.在我的BLL产品中,logic.GetDataByname(TextBox1.Text)的代码是:

This is executing properly but in textbox2 I am getting the data table name: asaa (asaa is my datatable) but I want the user password into the textbox. In my BLL productslogic.GetDataByname(TextBox1.Text) the code I am using is:

select password from asaa where name=@name

您有什么帮助吗?谢谢!

Any help from your side? Thank you!

推荐答案

编写此代码的原因是错误的.如果您自行设置密码,则拥有登录密码有什么意义(以某种方式!).. 如果要执行类似的操作,而不是删除登录名/密码,因为这是保护网站和个人首选项的步骤-为他们提供隐私和安全性. 设计或思考您打算做什么的另一种方式. The very reason to code this thing is wrong. Whats the point of having a login-password if you set the passowrd yourself (somehow!).. If you want to do something like that than remove login/password as they are steps of securing a site and individual preferences - giving them privacy and security. Design or think another way to what you are planning to do.

停止询问相同的问题.之前已被告知您不要执行此操作,并且您无法设置密码文本框的文本.关于此主题的任何其他问题都将被删除. Stop asking the same question. You have been told before not to do this and you cannot set the text of password textbox. Any further questions on this subject will be removed.

更多推荐

如何使用DAL和BLL从Databse向文本框写入值

本文发布于:2023-11-10 23:15:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1576737.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   文本框   BLL   DAL   Databse

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!