I want to call a stored procedure in SQL Server 2005 that returns an XML string that can then be passed into another method; I think the below code is right up until the point where I execute the query, but then I get a bit lost...
private string GetChartData(string OC_Ttl1, string OC_OL31, string OC_OL32)
{
string chartData;
//Prepare Connection Variables
SqlConnection conn_Org = new SqlConnection();
SqlCommand cmd_Org = new SqlCommand();
//Open Connection
conn_Org.ConnectionString = Set_OrgChartConn();
conn_Org.Open();
//Execute Procedure
cmd_Org.Connection = conn_Org;
cmd_Org.CommandText = "dbo.usp_CreateOrgDataSet '" + OC_Ttl1 +"','" + OC_OL31 + "'.'" + OC_OL32 +"'";
cmd_Org.CommandType = CommandType.StoredProcedure;
chartData = cmd_Org.ExecuteScalar();
conn_Org.Close();
return chartData;
}
Any ideas?