Web Forms :: Add Data In Database Using Autocomplete
Aug 22, 2012
I have to add data in database using autocomplete. if the data exist the old data will overwrite.if the data is not available new recourd will added in database.
eg- i have Product name, Product Qty and Product Price three text box if the product name is exist it display product price and also user can update price.and product name is not exist user can able to add new record. ....
Having a problem with autocomplete I put autocomplete control with textbox For data to be retrieved from database, I am putting .asmx file and .cs file for that Now I am giving .asmx file path in autocomplete. asmx file contains path for .cs file If this is the situation, autocomplete dont work and in .cs file , event is not fired.
But if i put that event from .cs file directly into the codebehing file of that control, then it works ok
How can i call an event in .cs file that is placed inside a app_code folder seperately from .aspx and .cs file of the autocomplete control
I'm creating a small project wherein i'm using MS Access Database to store the details. How to use autocomplete for Access Database. I used the code in your website to create an autocomplete textbox using SQL Server it is working but the same code for MS Access is not working.
public class WebService : System.Web.Services.WebService { MySql.Data.MySqlClient.MySqlCommand cmd = new MySqlCommand(); MySql.Data.MySqlClient.MySqlConnection con = new MySqlConnection(); //MySqlDataAdapter da = new MySqlDataAdapter(); MySqlDataReader dr; public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string[] GetCountryInfo(string prefixText) { int count = 10; string sql = "Select * from tbl_patientmaster Where P_NAME like '" + @prefixText + "%'"; con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["HMSDBConnectionString"].ToString(); con.Open(); MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, con); da.SelectCommand.Parameters.Add("@prefixText", MySql.Data.MySqlClient.MySqlDbType.VarChar, 50).Value = prefixText + "%"; System.Data.DataTable dt = new System.Data.DataTable(); da.Fill(dt); string[] items = new string[dt.Rows.Count]; int i = 0; foreach (System.Data.DataRow dr in dt.Rows) { items.SetValue(dr["P_NAME"].ToString(), i); i++; } return items; }
I' using ASP.net2.0 and SQL server2005.I have installed AJAX toolkit.
i want to make a search similar to google search ie retrieve from a database a list based on user typing characters and clicking search.
i have used a text box and AJAX autocomplete extender .i have made a connection to DB and able to make a list from a field. But when i select one list elment and click search button it doesn't go into the Search button on click event.Without using autocomplete i'm able retrieve records and display it on data grid view.Do i need to convert the list returned to an array.
I'm using jQuery AutoComplete Plugin in ASP.Net as outlined in the article below, so that as a user types in a .Net textbox they get a list of options to choose them. This works fine, but what I need to do now is call a server side function when the user has finished typing or has choosen a value, rather than the user having to submit the value by pressing a button.
I am using Ajaxtoolkit 3.5.I am using an autocomplete textbox extender.My problem is I have populated Country in the autocomplete textbox.I have to populate city in another dr
im new at asp. net and im making a web page with 3 dropdownlist filtering DATA, and then i display a Gridview with the data selected. But i also have some TextBoxs and i want them to autocomplete according to the filters i previously selected. Im working all of this with no code behind.
I am working on a large project where I have to present efficient way for a user to enter data into a form.
Three of the fields of that form require a value from a subset of a common data source (SQL Table). I used JQuery and JQuery UI to build an autocomplete, which posts to a generic HttpHandler.
Internally the handler uses Linq-to-sql to grab the data required from that specific table. The table has about 10 different columns, and the linq expression uses the SqlMethods.Like() to match the single search term on each of those 10 fields.
The problem is that that table contains some 20K rows. The autocomplete works flawlessly, accept the sheer volume of data introduces deleays, in the vicinity of 6 seconds or so (when debugging on my local machine) before it shows up.
The JqueryUI autocomplete has 0 delay, queries on the 3 key, and the result of the post is made in a Facebook style multi-row selectable options. (I almost had to rewrite the autocomplete plugin...).
So the problem is data vs. speed. Any thoughts on how to speed this up? The only two thoughts I had were to cache the data (How/Where?); or use straight up sql data reader for data access?
I'm using a JQuery plugin [URL] to add auto-completion to a "city" textfield. The component calls an ASP.NET page that simply loads an array of all possible city values (>8000) and then iterates that array returning those that start with the text the user has so far entered.
The thing is, it's pretty slow in real use. It lags behind what the user types to the extent that most of the time the user probably won't notice that it's there.
So, my question is, how can I speed it up?
I had thought that an array would be a better way to go than putting the data in a database and having to hit that multiple times. Do others agree that having this information hard-coded is the way to go given that it's not at all volatile and needs to be all about speed of return?
If so, what would you look at to improve the speed of performance? Should I be caching the data on application start and accessing it from memory? Would I be better off instead with multiple arrays, each containing values starting with a particular letter so I can go straight to the relevant one and thus iterate a much smaller array? Or am I missing a much more obvious way to go about this?
I have a request to create an auto complete that will search an data table. Is this achieveable quickly and simply or is it a case of writing a reasonable amount of code?
Originally, I have been using a webservice and linq to point at a single column's worth of data (IDDesc) and pull back the list of products:
However, if I wish the autocomplete to look at all the columns, is it a case of repeating similar LINQ statements for each of the columns contained within the datatable or is there a 'quick fix'?
I personally don't think this is an ideal scenario but it is a request I must work towards.
I have following requirements . On the search results associated with my autocomplete textbox i need checkbox to be associate with the result data . So that the end user can select multiple selection at a go .
I'm using asp.NET MVC, and am looking at the JQuery autocomplete plugin for what I want to do. I need some extra functionality that I don't think it provides.
I have a page with two text fields, First and Last name. Ideally, when someone begins typing into either, I would like autocomplete to display both the first and last name of all matches. If one of these matches were selected, I would like only the appropriate (first/last) name to go into the current field, while the other field is also filled in with the appropriate name.
So the problems here are that A) I would like the suggestion text to be different from the value that would be filled into the current field, and B) I would like to update multiple fields from a single autocomplete. Does this make sense? It seems to be difficult to find information on this situation on the net.
i have been implementing your Autocomplete routine, However there does seem to be a problem in that it does not allow you to pick a value through a mouse click. The enter key is fine.
I am using j-query auto complete plugin in textbox that is inside gridview. The autocomplete only works when my gridview has more than 1 row, if my gridview has only one row then the autocomplete will not work. I am using the same code i downloaded from this website. Here is my code for the gridview:
i am using JQuery UI Autocomplete with asp.net textbox.AutoComplete works right.but how can i assign selected ID of returned Data to an hiddenField?My server Side Function returned list of objects that contains (this is an example) :
public List<Employee> GetEmployeeList() { List<Employee> empList = new List<Employee>(); empList.Add(new Employee() { ID = 1, Email = "Mary@somemail.com" }); empList.Add(new Employee() { ID = 2, Email = "John@somemail.com" }); empList.Add(new Employee() { ID = 3, Email = "Amber@somemail.com" }); empList.Add(new Employee() { ID = 4, Email = "Kathy@somemail.com" }); empList.Add(new Employee() { ID = 5, Email = "Lena@somemail.com" }); empList.Add(new Employee() { ID = 6, Email = "Susanne@somemail.com" }); empList.Add(new Employee() { ID = 7, Email = "Johnjim@somemail.com" }); empList.Add(new Employee() { ID = 8, Email = "Jonay@somemail.com" }); empList.Add(new Employee() { ID = 9, Email = "Robert@somemail.com" }); empList.Add(new Employee() { ID = 10, Email = "Krishna@somemail.com" }); return empList; } and this is ASPX Code : <form id="form1" runat="server"> <div class="demo"> <div class="ui-widget"> <label for="tbAuto"> Enter Email: </label> <asp:TextBox ID="tbAuto" class="tb" runat="server"> </asp:TextBox> </div> </div> <asp:TextBox ID="TextBox1" runat="server"> </asp:TextBox> <asp:Label runat="server" ID="lbl" Text=""></asp:Label> <asp:HiddenField runat="server" ID="hidid" /> <asp:Button ID="Button1" runat="server" Text="Button" /> </form>
here is my jquery Code :
<script type="text/javascript"> $(function () { $(".tb").autocomplete({ select: function( event, ui ) { // now assign the id of the selected element into your hidden field $("#<%= hidid.ClientID %>").val( ui.item.ID ); }, source: function (request, response) { $.ajax({ url: "Default.aspx/FetchEmailList", data: "{ 'mail': '" + request.term + "' }", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", dataFilter: function (data) { return data; }, success: function (data) { response($.map(data.d, function (item) { return { value: item.Email } } ) ) } , error: function (XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); alert(errorThrown); } }); }, minLength: 1 }); }); </script>
And this is My WEb Method Side Code :
<WebMethod()> _ Public Shared Function FetchEmailList(ByVal mail As String) As List(Of Employee) Dim emp = New Employee() Dim fetchEmail = emp.GetEmployeeList() Return fetchEmail End Function
I am using autocomplete jquery textbox in gridview , for first time when grid view is binded autocomplete jquery textbox works , when new row is dynamically added with textbox, the code is not working
I have Used Ajax AutoComplete Extender In my Project But MY List Does Not Show On Ajax Model Popup Ajax Extender Sugges me Css For Display My Auto Complete List On Model Pouup Ajax Extender
I found this usefull code in this website but i was wondering a way to select a multiple names in textbox inside GridView. I have seen one exampe on this website but the example is not in GridView. Here is my code that works fine now but it does not let me select multiple names:
I am trying to use j-query autocomplete but i am getting this error: "The name 'txt_UID' does not exist in the current context" ..
I am using the code but the example I was following uses a text-box that was outside of the gridview. But my textbox is inside the gridview.
How can I make the autocomplete to work a text-box that is inside gridview?
-- Here is my javascript <script type="text/javascript"> $(document).ready(function () { $("#<%=txt_UID.ClientID %>").autocomplete({ source: function (request, response) {
[Code] .....
-- and here is my gridview: <asp:GridView ID="GridView1" runat="server" Width="870px" AutoGenerateColumns="False" Font-Names="Arial" Font-Size="11pt" AlternatingRowStyle-BackColor="#C2D69B" HeaderStyle-BackColor="green" ShowFooter="True" CellPadding="4" BackColor="White" BorderColor="#336666"
I am using ASP.NET AJAX Autocomplete to load the data. I am fetching data from a Dataset, which is store in Session. The table length is approx 1000 rows.I use DataView to and Table.Select ("Data Like '"+ inputvalue +"'") to filter data on each keystroke.I am wondering, what's the best and fastest way to store and fetch data for Autocomplete?