Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Created Unassigned: AJAX ComboBox [27737]

$
0
0
Hi, i have issue with my combobox. Everything is working fine but i need my multiple column combobox to display only one column. What i need is when i select one value from it, where one row contain id number and name, to display only the id number. I use database from sql server for filling the combobox.

working in C#.

using (SqlConnection sqlConnection = new SqlConnection("Data Source=MILAN\\SQLEXPRESS;Initial Catalog=sm;Integrated Security=True"))
{
string sql = "sql";
SqlCommand sqlCmd = new SqlCommand(sql, sqlConnection);
sqlConnection.Open();

SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);

sqlDa.Fill(dt);

for (int i = 0; i < dt.Rows.Count; i++)
{
id = dt.Rows[i]["column_1"].ToString();
name = dt.Rows[i]["column_2"].ToString();
newName = id + " | " + name;
}

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>