从mysql数据库自动完成asp.net中的Textbox [英] Auto complete Textbox in asp.net from mysql database

查看:80
本文介绍了从mysql数据库自动完成asp.net中的Textbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在mys.net数据库中实现asp.net中的自动完成文本框。从此链接 http:/ /www.aspdotnet-suresh.com/2015/05/jquery-autocomplete-textbox-example-in-master-using-webservice-in-aspnet.html [ ^ ]我成功地从SQL SERVER实现,但在使用MYSQL数据库时我无法从数据库中获取价值。所以请帮我从MYSQL数据库实现自动完成文本框。

解决方案

使用MySql数据库,你必须在MySQLConnector的帮助下更改连接。



你的jquery代码仍将保持不变,只是连接字符串和后面的代码会改变。



MySql连接字符串



以下是连接字符串MySql数据库。



 <   connectionstrings  >  
< add name = constr connectionstring = 数据源= localhost; port = 3306;初始目录= SampleDB;用户ID = abc;密码= pass @ 123 / >
< / connectionstrings >





命名空间



您将需要导入以下命名空间。



 使用 System.Data; 
使用 System.Configuration;
使用 MySql.Data.MySqlClient;







请参阅此处了解详细信息: http://www.aspsnippets.com/Articles/Use-and-connect-to-MySQL-Database-in-ASPNet-Application-using-MySQLConnector.aspx [ ^


How to implement auto complete textbox in asp.net from mysql database. From this link http://www.aspdotnet-suresh.com/2015/05/jquery-autocomplete-textbox-example-in-master-using-webservice-in-aspnet.html[^] I successfully implemented from SQL SERVER, but while using MYSQL Database i cant get value from database.So please help me to implement auto complete textbox from MYSQL Database.

解决方案

While using MySql database you will have to change the connection with the help of MySQLConnector.

Your jquery code will still remain the same, just the connection string and code behind will change.

MySql Connection String

Below is the connection string to the MySql Database.

<connectionstrings>
    <add name="constr" connectionstring="Data Source=localhost;port=3306;Initial Catalog=SampleDB;User Id=abc;password=pass@123" />
</connectionstrings>



Namespaces

You will need to import the following namespaces.

using System.Data;
using System.Configuration;
using MySql.Data.MySqlClient;




Please refer here for full details: http://www.aspsnippets.com/Articles/Use-and-connect-to-MySQL-Database-in-ASPNet-Application-using-MySQLConnector.aspx[^]


这篇关于从mysql数据库自动完成asp.net中的Textbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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