As title really.
I want to object just one specific value from a colum on one row of a SQL database.
The PHP code I would use would be:
$result = mysql_query("SELECT price FROM delivery WHERE id='$id'");
echo mysql_result($result,0);
That would get me the price from what ever autoinc id I choose.
As I’m new to C# its quite tricky to get my head around as there seems to be many different methods to obtain the same results.
Any help would be appreciated, thanks!
EDIT
I’m using System.Data.SqlClient as, so far, its done me proud.
If data type of PRICE column you want to retrieve is a scalar value and you’ll get only one record then I assume the most efficient way would be ExecuteScalar() method. Here’s a little sample code: