Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
PraiseRe: solved thanks to Randor ... but, it's a kinky one ! Pin
Randor 11-Mar-22 12:27
professional Randor 11-Mar-22 12:27 
GeneralRe: solved thanks to Randor ... but, it's a kinky one ! Pin
BillWoodruff11-Mar-22 17:04
professionalBillWoodruff11-Mar-22 17:04 
Questionc# programming Pin
Member 155562105-Mar-22 5:01
Member 155562105-Mar-22 5:01 
AnswerRe: c# programming Pin
Dave Kreskowiak5-Mar-22 5:13
mveDave Kreskowiak5-Mar-22 5:13 
AnswerRe: c# programming Pin
OriginalGriff5-Mar-22 5:56
mveOriginalGriff5-Mar-22 5:56 
QuestionCrystalReport Viewer Pin
Luis M. Rojas3-Mar-22 5:39
Luis M. Rojas3-Mar-22 5:39 
AnswerRe: CrystalReport Viewer Pin
Mycroft Holmes3-Mar-22 11:44
professionalMycroft Holmes3-Mar-22 11:44 
QuestionC# List Pin
Member 155527492-Mar-22 1:41
Member 155527492-Mar-22 1:41 
public List<T> DatasettoList<T>(string commandText, CommandType commandType, IDbDataParameter[] parameters = null) where T : class, new()
        {
            DataSet dataSet = new DataSet();
            if ((commandType == null) || (commandText == null) || (commandText.Length == 0))
            {
                throw new Exception("Invailid command");
            }
            dataSet = GetDataSet(commandText, commandType, parameters);
            if (dataSet.Tables.Count == 0)
            {
                return null;
            }
            if (dataSet.Tables[0].Rows.Count == 0)
            {
                return null;
            }
            ProposalDownloadView prop = new ProposalDownloadView();
            List<ProposalDownloadView> proplist = new List<ProposalDownloadView>();
            List<T> list = new List<T>();
            var myData = dataSet.Tables[0].AsEnumerable().Select(r => new
            {
                UserId = r.Field<string>("UserId"),
                UseProposalNorId = r.Field<int>("UseProposalNorId"),
                FromDate = r.Field<decimal?>("FromDate"),
                ToDate = r.Field<decimal?>("ToDate")
            }).ToList();
            list = myData.ToList(); // this line creates the error
            return list;
        }



I am unbale to return list after above code third list line creates error. Please help. Thanks in advance
AnswerRe: C# List Pin
Richard Deeming2-Mar-22 2:09
mveRichard Deeming2-Mar-22 2:09 
SuggestionWhy does the music stop ? Pin
Member 155522211-Mar-22 19:46
Member 155522211-Mar-22 19:46 
GeneralRe: Why does the music stop ? Pin
OriginalGriff1-Mar-22 20:01
mveOriginalGriff1-Mar-22 20:01 
GeneralRe: Why does the music stop ? Pin
Pete O'Hanlon1-Mar-22 22:14
mvePete O'Hanlon1-Mar-22 22:14 
QuestionC# Trouble passing a string var : Form1 to Forms and back again Pin
Member 155520191-Mar-22 12:09
Member 155520191-Mar-22 12:09 
AnswerRe: C# Trouble passing a string var : Form1 to Forms and back again Pin
OriginalGriff1-Mar-22 20:00
mveOriginalGriff1-Mar-22 20:00 
QuestionRefer a class in C# but don't recognized Pin
ernteSKY24-Feb-22 14:38
ernteSKY24-Feb-22 14:38 
AnswerRe: Refer a class in C# but don't recognized Pin
OriginalGriff24-Feb-22 19:35
mveOriginalGriff24-Feb-22 19:35 
QuestionConditional Compiler Symbols Pin
Kevin Marois22-Feb-22 11:00
professionalKevin Marois22-Feb-22 11:00 
AnswerRe: Conditional Compiler Symbols Pin
OriginalGriff22-Feb-22 11:14
mveOriginalGriff22-Feb-22 11:14 
GeneralRe: Conditional Compiler Symbols Pin
Kevin Marois22-Feb-22 12:25
professionalKevin Marois22-Feb-22 12:25 
GeneralRe: Conditional Compiler Symbols Pin
trønderen22-Feb-22 15:03
trønderen22-Feb-22 15:03 
GeneralRe: Conditional Compiler Symbols Pin
OriginalGriff22-Feb-22 20:11
mveOriginalGriff22-Feb-22 20:11 
Questionwhat is the right place to await Task.WhenAll Pin
Kumara Prathipati 202119-Feb-22 15:04
Kumara Prathipati 202119-Feb-22 15:04 
AnswerRe: what is the right place to await Task.WhenAll Pin
Richard Deeming24-Feb-22 0:24
mveRichard Deeming24-Feb-22 0:24 
QuestionVisual Studio 2022 Dark Image In Panel Pin
GP66612-Feb-22 7:37
GP66612-Feb-22 7:37 
QuestionRe: Visual Studio 2022 Dark Image In Panel Pin
Eddy Vluggen12-Feb-22 10:45
professionalEddy Vluggen12-Feb-22 10:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.