通过文本输入连接到数据库 [英] Connecting to database on text enter

查看:92
本文介绍了通过文本输入连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在文本框中输入数据时如何访问数据库?

How to access the database when we enter the data in textbox?

推荐答案

此功能仅适用于Windows应用程序,我的建议不在Web中使用application
This feature only suitable for windows application & my suggestion don''t use in web application


您可以处理文本框的TextChanged事件.在那里,您可以使用OleDbConnection连接到访问表并执行操作.
You can handle the TextChanged event of the textbox. There you can connect to the access table using OleDbConnection and perform your operations.


这是用于在文本框1上更改文本时连接数据库的事件

//TextChanged更改的事件
私有void textBox1_TextChanged(对象发送者,EventArgs e)
{
//在此处输入用于数据库连接的代码
}


谢谢,
Raja.S
This is the Event for To Connect DB On Text Change Event For TextBox1

// TextChanged Changed Event
private void textBox1_TextChanged(object sender, EventArgs e)
{
// Type your code here for DB Connection
}


Thanks,
Raja.S


这篇关于通过文本输入连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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