Hi!
I want to ask some help this problem. I want my combobox autocomplete dropdown in how many columns and merge the rows in one combo box text.
=====================================================================
string conStringBranchFund = txtpath;
SqlConnection connBranchFund = new SqlConnection(conStringBranchFund);
connBranchFund.Open();
string query = "select AccountNumberBranch, AccountBank, AccountNumber from AccountNumBranch order by AccountNumber";
SqlCommand cmd = new SqlCommand(query, connBranchFund);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
CbBranchFunds.Text = reader.GetString(0) + " (" + reader.GetString(1) + ") " + reader.GetString(2);
}
SqlConnection connBranchFund = new SqlConnection(conStringBranchFund);
connBranchFund.Open();
string query = "select AccountNumberBranch, AccountBank, AccountNumber from AccountNumBranch order by AccountNumber";
SqlCommand cmd = new SqlCommand(query, connBranchFund);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
CbBranchFunds.Text = reader.GetString(0) + " (" + reader.GetString(1) + ") " + reader.GetString(2);
}
====================================================================
This code display only one row, the last row. I want to be drop completely in how many columns ...thank you in advance.


Amit GuptaRank #190 · 12.8K reputationPosted Jun 28, 2017, 1:06 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Jun 28, 2017, 12:13 AM EDT
Black Diamond191 reputationPosted Jun 28, 2017, 12:31 AM EDT
Anil JhaRank #1,988 · 733 reputationPosted Jun 28, 2017, 12:37 AM EDT
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 28, 2017, 12:38 AM EDT
Black Diamond191 reputationPosted Jun 28, 2017, 1:00 AM EDT
Black Diamond191 reputationPosted Jun 28, 2017, 1:02 AM EDT
SqlConnection connBranchFund = new SqlConnection(conStringBranchFund);
connBranchFund.Open();
//string query = "select AccountNumberBranch, AccountBank, AccountNumber from AccountNumBranch order by AccountNumber";
string query = "select AccountNumberBranch, AccountBank, AccountNumber from AccountNumBranch order by AccountNumber";
SqlCommand cmd = new SqlCommand(query, connBranchFund);
SqlDataReader reader = cmd.ExecuteReader();
int numRows = 0;
int num = 0;
numRows = DataBankfund.Rows.Count;
for (reader.Read(); num <= numRows; num++)
{
CbBranchFunds.Text = reader.GetString(0) + " (" + reader.GetString(1) + ") " + reader.GetString(2);
}
Black Diamond191 reputationPosted Jun 28, 2017, 1:15 AM EDT