Link to home
Start Free TrialLog in
Avatar of directxBOB
directxBOBFlag for Ireland

asked on

SQL Query & C# Objects

I Have:

            command.Connection = connection;
            command.CommandText = "select * from Cards where CardID_PK = '" + cardId + "'";
            command.ExecuteNonQuery();

Which basically grabs the card with the matching id.

My question is rather simple how would I get this data back as a collection / dataset so I can manipulate it?

More importantly say I am getting back multiple cards or multiple accounts how do I then handle these? I am most likely just missing a container step for handling?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
And Bob's way works very wel, particularly if you have no interest in writing anything back to the table.