Erwin Pombett
asked on
i have a command (query) against microsoft sql server, i ask only one value, i have it , how can i recover it ?
Hello ,
i have a code that query a mssql db as follows :
$query = "SELECT email From Person Where EmployeeID='ESC" + $person.Split(';')[0] +"'"
$command = $connection.CreateCommand( )
$command.CommandText = $query
$result = $command.ExecuteReader()
question :
how to recover the email value ??? how should i use $command in order to have one value not a table ?
thank you in advance.
i have a code that query a mssql db as follows :
$query = "SELECT email From Person Where EmployeeID='ESC" + $person.Split(';')[0] +"'"
$command = $connection.CreateCommand(
$command.CommandText = $query
$result = $command.ExecuteReader()
question :
how to recover the email value ??? how should i use $command in order to have one value not a table ?
thank you in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually, the variable $Email contains the value you're looking for.
ASKER
am i forced to create a datatable ?
is it not possible as it 's only one value, get it straight into a simple variable ?
thank you for further help.
toshi