hi
i want to use autocomplete in asp.net using vb
i have to select budget head
on selection of budget head the budget code and the budgettypecode should be displayed as per the selected item.
following is what i have done :
html code:
Code:
<td width="20%" align="left">
<span>
<asp:TextBox ID="txtItemName" runat="server" MaxLength="50" Width="100px"></asp:TextBox>
</span>
<asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtItemName"
MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000"
ServiceMethod="GetDetails">
</asp:AutoCompleteExtender>
</td>
vb code
Code:
<System.Web.Script.Services.ScriptMethod()> _
<System.Web.Services.WebMethod()> _
Public Shared Function GetDetails(prefixText As String) As DataSet
Dim constr As String = ConfigurationManager.ConnectionStrings("SqlConnectionString").ToString()
Dim con As New SqlConnection(constr)
Dim mC As String = "select ItemName, ItemCode, BudgetTypeCode from ItemMaster where ItemName like @City+'%'"
Dim da_T As New SqlDataAdapter(mC, con)
Dim ds_T As New DataSet
da_T.Fill(ds_T, "ItemMaster")
Return ds_T
End Function
if i use a list item instead of dataset then it is working perfect but only for txtitemname.
but as the txtitemname is selected the txtitemcode and the txtbudgettypecode too should change from the values in the datatable.
a lot confused as to how to make this work
pls guide.
thanks in advance.