المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Need help with binding source



C# Programming
04-06-2009, 11:41 PM
i am trying to show the records in labels like so:

User Name User
Alias Alias
Income Income
Gender Gender
Age Age

and then i want the buttons to control so i can hit next to show the next record


so for that i have this code

public void GetUserMatch(XmlNode usersNode, string CritBody, string CritAgeFrom, string CritAgeTo, string CritHeightFrom, string CritHeightTo)
{
XmlNodeList userNodes = usersNode.SelectNodes("Clients");
Users[] users = new Users[userNodes.Count];
MatchUsers[] matchUser = new MatchUsers[users.Length];
for (int i = 0x0; i < users.Length; i++)
{
XmlNode userNode = userNodes[i];
string userName = userNode.SelectSingleNode("Username").InnerText;
string alias = userNode.SelectSingleNode("Alias").InnerText;
string bodyType = userNode.SelectSingleNode("BodyType").InnerText;
string strheight = userNode.SelectSingleNode("Heightft").InnerText;
string displayheight = userNode.SelectSingleNode("DisplayHeight").InnerText;
string strage = userNode.SelectSingleNode("Age").InnerText;
string gender = userNode.SelectSingleNode("Gender").InnerText;
string income = userNode.SelectSingleNode("Income").InnerText;

int intHeight = Convert.ToInt32(strheight);
int intAge = Convert.ToInt32(strage);

users[i] = new Users(userName, alias, bodyType, intHeight, displayheight, intAge, gender, income);
}



MatchUsers[] matchUsers = new MatchUsers[0];
int ii = 0;
foreach (Users mUser in users)
{


string Bodytype = mUser.BodyType;
if (string.Compare(Bodytype, CritBody) == 0)
{
int intAge = Convert.ToInt32(mUser.Age);
if (intAge >= Convert.ToInt32(CritAgeFrom) & intAge = Convert.ToInt32(CritHeightFrom) & intHeight