In my Sp, which returns only one record always. I need to take the values of each column to separate variable. I did as follows (part of my c#),
DataSet sampleDataTable = DataAccessManager.ExecuteStoredProcedure("spGetUserData", parameters);
string accNo = Convert.ToString(sampleDataTable.Tables[0].Rows[0]["AccountNumber"]);
The above code works fine. I also tried as follows,
string accNo = nonProvidedServices.Tables[0].AsEnumerable().Select(row => row.Field<string>("AccountNumber")).ToString();
But it's not working properly. What is the best and efficient way to assign datatable
column value to a string variable? Is Linq query efficient than my working code?