I have a stored-procedure like this :
ALTER PROCEDURE [dbo].[SelectUserInfo]
AS
BEGIN
select * from User_Info
END
and I am using LINQ to call this procedure and want store the data in a datatable or dataset
here what I am doing :
DataClassesDataContext dc = new DataClassesDataContext();
DataTable dt = null;
dt = (DataTable)dc.SelectUserInfo();
but its not working its giving error.
the error is this :
Unable to cast object of type 'SingleResult`1[SelectUserInfoResult]' to type 'System.Data.DataTable'.
Please help me to do this ...
SelectUserInfoResultswhich you must have defined it in some function import.