|
-
Sep 29th, 2007, 07:20 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Can someone please comment this code for better understanding: reader = comm.ExecuteR
SqlCommand comm = new SqlCommand("SELECT * FROM UsrTbl, RelativeTable, IP_Table WHERE RelativeTable.UserID IN (SELECT UserID FROM UsrTbl WHERE UserName = @usrnmeLbl)", conn);
comm.Parameters.AddWithValue("@usrnmeLbl", usrNmeLbl.Text);
SqlDataReader reader = comm.ExecuteReader();
//Check to see if the reader has data(Did the username exist in the database? We must check this
if (reader.Read() != false)
I see that comm is a SqlCommand object with the sql command parameters passed to it. Then I believe reader is a data reader object that is being told to reference something about the comm object. But what is it? Is it a property(ExecuteReader())?
Or is it some kind of object creation method that then creates a new reader object that can act like an indexer.
If someone could point out my misconceptions I would really appreciate it.
Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|