I don't know if I'm in the right forum but could not find one for Powershell.
I need to return 1 piece of data from a sql database to a variable. I don't want the column headings. Here's what I have so far:
Function GetMenuGroup ([int]$StoreID)
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Server=Servername;Database=DatabaseName;Integrated Security=True"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = "exec storedProcedure $StoreID"
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$MG=Getdata 2 |out-string
Here's the results I get now - How do I return just "DatathatIreallyWant" in a string variable? I don't want the column or underline.
View Complete Post