Retreiving User Details

Hey,

I am using the following web method to retreive users details:-

public class Person

{

public string user_id, username, password, email, avatar, date_added, real_name, location, website, occupation, interests, forum_posts;

}

[WebMethod(Description = "This web method will display the profile of specific users.")]public Person User_Details(int id)

{

Person user = new Person();

const string connStr = "Provider=Microsoft.Jet.OleDb.4.0; " + "Data Source=|DataDirectory|forum.mdb;";

OleDbConnection dbConn = new OleDbConnection(connStr);

string sqlStr = "SELECT [user_id], [username], [password_test], [avatar], [date_added], Email, [real_name] " +"[location], [website], [occupation], [interests], [forum_posts] FROM members WHERE user_id = '" + id + "'";

dbConn.Open();

OleDbCommand dbCommand = new OleDbCommand(sqlStr, dbConn);

OleDbDataReader dbReader = dbCommand.ExecuteReader();while (dbReader.Read())

{

user.user_id = dbReader["user_id"].ToString();

user.username = dbReader["username"].ToString();

user.email = dbReader["email"].ToString();

user.avatar = dbReader["avatar"].ToString();

user.date_added = dbReader["date_added"].ToString();

user.real_name = dbReader["real_name"].ToString();

user.location = dbReader["location"].ToString();

user.website = dbReader["website"].ToString();

user.occupation = dbReader["occupation"].ToString();

user.interests = dbReader["interests"].ToString();user.forum_posts = dbReader["forum_posts"].ToString();

}

dbReader.Close();

return user;

}

the website i am creating is a forum. Here users can click on other users names and view their profile.. What i need to do is consume this web service so that i can do this.. but i dont know how exactly to do it?

I did try with the following code..

localhost.Service myws = new localhost.Service();

localhost.Person member = new localhost.Person();

member.user_id = Request.QueryString["ID"];

Label1.Text = member.username;

Label2.Text = member.date_added;

But it does not work, the querystring holds the user_id of the user so i thought from this it would be easy to pull out everything else..

Any help would be much appreciated.

Thanks

Regards

0
billy_111
5/5/2009 12:44:19 AM
asp.net.getting-started 91979 articles. 2 followers. Follow

1 Replies
619 Views

Similar Articles

[PageSpeed] 15

It looks like you need to call the web service:

Person member = myws.User_Details(userid);


Steve Wellens

My blog
0
SGWellens
5/5/2009 1:05:30 AM
Reply:

Web resources about - Retreiving User Details - asp.net.getting-started

Geotagging – one day later
The First Day When we were doing our projections for how many photos Flickr members would geotag, we though that we’d hit a million in the first ...

User Terence Eden - Stack Overflow
current community chat blog Stack Overflow Meta Stack Overflow Stack Overflow Careers your communities Sign up or log in to customize your list. ...

Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Sumisha Naidu @ sumishanaidu ...

Wikipedia talk:WikiProject Sociology/Archive 5 - Wikipedia, the free encyclopedia
Culture has been nominated for a good article reassessment . Articles are typically reviewed for one week. Please leave your comments and help ...

Patient zero: ‘healer’ claimed to have powers to cure Ebola before she died of the disease
A herbalist working in a remote village in Sierra Leone who claimed she had special powers to cure Ebola may have helped the disease spread across ...

Member Login - Peoplebank Australia - IT Jobs and IT Recruitment
Peoplebank are Australias leading IT Recruitment Company Peoplebank have a focus on Temporary IT Recruitment Contract IT Recruitment Executive ...

IOS 7 - what do/don't you like - iPhone - Whirlpool Forums
... I like pretty much all of it, except the fact that you can no longer restrict how many email messages it downloads. It has been retreiving ...

How To Develop with Programmable Web API - APIhub
A Note from the Editor in Chief of ProgrammableWeb.com: In April 2014, ProgrammableWeb was both replatformed and redesigned. As a part of the ...

Arthrex - Forgot Username
Apps Arthrex.com Arthrex Vet Systems OrthoIllustrated.com TPT Online Shopping Germany / English Country: Afghanistan Åland Islands Albania Algeria ...

Conference App Secrets Part 3: JSON vs XML
Guest post by Ekkehard Gentz, BlackBerry Elite Developer This is Part 3 of my series, "Conference App Secrets." In Part 1, I demonstrated How ...

Resources last updated: 12/26/2015 11:54:58 PM