private void FillCredentialsComboBox() { DataTable CredentialsDataTable = VSWebBL.ConfiguratorBL.ServicesBL.Ins.GetCredentials(); CredentialsComboBox.DataSource = CredentialsDataTable; DataRow[] CredentialsRow = CredentialsDataTable.Select("AliasName = '" + CredentialsComboBox.Text+ "'"); if(CredentialsRow.Length > 0) { int avalue = Convert.ToInt32(CredentialsRow[0]["ID"].ToString()); Session["CredID"] = avalue; } //int credentialid=Convert.ToInt32(CredentialsDataTable.Select("ID" AND AliasName=Session["importcredential"].ToString())); CredentialsComboBox.TextField = "AliasName"; CredentialsComboBox.ValueField = "ID"; CredentialsComboBox.DataBind(); //if (CredentialsComboBox.Items.Count > 0) // CredentialsComboBox.Items[CredentialsComboBox.Items.Count - 2].Selected = true; if (CredentialsRow.Length > 0) { for (int i = 0; i < CredentialsComboBox.Items.Count; i++) { if (CredentialsComboBox.Items[i].Text == Session["importcredential"].ToString()) CredentialsComboBox.Items[i].Selected = true; } } }
private void FillCredentialsComboBox() { DataTable CredentialsDataTable = VSWebBL.ConfiguratorBL.ServicesBL.Ins.GetCredentials(); CredentialsComboBox.DataSource = CredentialsDataTable; CredentialsComboBox.TextField = "AliasName"; CredentialsComboBox.ValueField = "ID"; CredentialsComboBox.DataBind(); }
protected void filldropdown_CredentialsComboBox() { DataTable dt = new DataTable(); //string item = CredentialsComboBox.SelectedItem.Text; dt = VSWebBL.ConfiguratorBL.UserPreferencesBL.Ins.filldropdown_CredentialsComboBox(); CredentialsComboBox.DataSource = dt; CredentialsComboBox.DataBind(); }
private void FillCredentialsComboBox() { DataTable CredentialsDataTable = VSWebBL.ConfiguratorBL.ServicesBL.Ins.GetCredentials(); CredentialsComboBox.DataSource = CredentialsDataTable; CredentialsComboBox.TextField = "AliasName"; CredentialsComboBox.ValueField = "ID"; CredentialsComboBox.DataBind(); if (CredentialsComboBox.Items.Count > 0) { CredentialsComboBox.Items[CredentialsComboBox.Items.Count - 1].Selected = true; } }