TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
abburi chowdary
NA
60
14.9k
How can we get the exact datain combobox2 on selecting comb1
Apr 30 2018 12:58 AM
hi,
I have two comboboxes were in combobo1 i have data of hospitals and linked hospital users to combobox but while i running the outpit i amnot getting exact list of users who all under certain hopspital, how can we get the same
void
CmbHospitalsSelectedIndexChanged(
object
sender, EventArgs e)
{
try
{
dynamic refobj = cmbHospitals.SelectedItem;
MessageBox.Show(refobj.Key);
cmbhusers.SelectedIndex = -1;
cmbhusers.Items.Clear();
if
(
true
)
{
WebClient wc =
new
WebClient();
wc.Headers[
"Content-type"
] =
"application/x-www-form-urlencoded"
;
NameValueCollection collection =
new
NameValueCollection();
collection.Add(
"hid"
,cmbHospitals.SelectedIndex.ToString());
collection.Add(
"sno"
,
"4"
);
byte
[] bret = wc.UploadValues(URLAuth, collection);
string
sret =
""
;
sret = System.Text.Encoding.ASCII.GetString(bret);
int
count=0;
string
[,] husers ;
if
(sret !=
""
)
{
XmlDocument readDoc =
new
XmlDocument();
readDoc.LoadXml(sret);
count = readDoc.SelectNodes(
"hospitalusers/huids"
).Count;
husers =
new
string
[count, 2];
XmlNodeList xhuid = readDoc.GetElementsByTagName(
"huid"
);
XmlNodeList xuser_name = readDoc.GetElementsByTagName(
"user_name"
);
for
(
int
i= 0; i < count; i++)
{
husers[i,0] = xhuid[i].InnerText;
husers[i, 1] = xuser_name[i].InnerText;
}
cmbhusers.DisplayMember=
"text"
;
cmbhusers.ValueMember=
"key"
;
for
(
int
i = 0; i < husers.GetLength(0); i++)
{
cmbhusers.Items.Add(
new
{ text = husers[i, 1], key=Convert.ToInt16(husers[i,0])});
}
}
}
}
catch
(NullReferenceException e1)
{
MessageBox.Show(e1.Message);
}
}
Reply
Answers (
0
)
Database structure for advance/due payment
passing data from controller to view is showing NAN value