Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Dear programmers

I have an issue on how to load another column in database which related to other autocomplete text box

here is my code
C#
private void loadautocompleteitemcodelist()
        {
            DataSet ds = null;
            ds = _brItem.getitemcodedataset();
            AutoCompleteStringCollection col = new AutoCompleteStringCollection();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                col.Add(dr["ITEMCODE"].ToString());
            }
            txtNewCode.AutoCompleteCustomSource = col;
            txtNewCode.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            txtNewCode.AutoCompleteSource = AutoCompleteSource.CustomSource;
        }


eg: I need when I select one itemcode and it should display the relevant type in other auto complete textbox
Posted
Updated 11-Feb-14 17:44pm
v2
Comments
BillWoodruff 12-Feb-14 3:29am    
"Select one itemcode" in what ? Show the code where 'itemCode is changed.
Asa code 12-Feb-14 6:14am    
public DataSet getitemcode()
{
try
{
string query = "select * from M_ITEM";
DbCommand cmd = dbFactory.GetSqlStringCommand(query);
DataSet ds = dbFactory.ExecuteDataSet(cmd);
return ds;
}
catch (Exception ex)
{
throw ex;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900