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 GuptaPosted Jun 28, 2017, 5:06 AM
Black DiamondPosted Jun 28, 2017, 5:15 AM
Black DiamondPosted Jun 28, 2017, 5:02 AM
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 DiamondPosted Jun 28, 2017, 5:00 AM
Rajkiran SwainPosted Jun 28, 2017, 4:38 AM
Anil JhaPosted Jun 28, 2017, 4:37 AM
Black DiamondPosted Jun 28, 2017, 4:31 AM
Amit GuptaPosted Jun 28, 2017, 4:13 AM