C# - Getting record from a row using DataRow

Posted by pinkcupcake on Stack Overflow See other posts from Stack Overflow or by pinkcupcake
Published on 2012-06-06T16:24:33Z Indexed on 2012/06/06 16:40 UTC
Read the original article Hit count: 200

Filed under:
|
|
|

I'm trying to get record of a row using DataRow. Here's what I've done so far:

 uID = int.Parse(Request.QueryString["id"]);
 PhotoDataSetTableAdapters.MembersTableAdapter mem = new PhotoDataSetTableAdapters.MembersTableAdapter();
 PhotoDataSet.MembersDataTable memTable = mem.GetMemberByID(uID);
 DataRow[] dr = memTable.Select("userID = uID");
 string uName = dr["username"].ToString();

Then I got the error:

Cannot implicitly convert type 'string' to 'int'

The error points to "username". I don't know what's wrong because I'm just trying to assign a string variable to a string value. Anyone figures out the reason of the error? Please help and thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about row