Simple way to get data

Results 1 to 2 of 2

Thread: Simple way to get data

  1. #1
    Join Date
    Dec 1969

    Default Simple way to get data

    Hi,<BR><BR>this may seem like a straight forward problem but i am new to .net and all, so bear with me. I want to use a SQL Server stored procedure to extract some data and put it in a class. I don&#039;t want to display it yet, just extract it from the DB. <BR><BR>is there any way of accessing the individual columns that a stored procedure returns? Perhaps something like cmdData.Item[0].Value???<BR><BR>the obvious solution is to have multiple output params but this seems stupid when i just want one whole record.<BR><BR>Hope this make sense,<BR><BR>James

  2. #2
    Join Date
    Dec 1969

    Default RE: Simple way to get data

    A DataReader is very efficient, especially if you are just pulling one row.<BR><BR>myDataReader = mySqlCommand.ExecuteReader(CommandBehavior.SingleR ow)<BR><BR>And then you can access the colums like...<BR><BR>myVar = myDataReader("myColumn")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts