Click here to Skip to main content
15,914,500 members
Home / Discussions / C#
   

C#

 
GeneralRe: Working with list(Please help) Pin
Henry Minute26-May-10 2:50
Henry Minute26-May-10 2:50 
GeneralRe: Working with list(Please help) Pin
future383926-May-10 3:04
future383926-May-10 3:04 
AnswerRe: Working with list(Please help) Pin
Henry Minute26-May-10 3:36
Henry Minute26-May-10 3:36 
GeneralRe: Working with list(Please help) Pin
Alaric_26-May-10 4:02
professionalAlaric_26-May-10 4:02 
GeneralRe: Working with list(Please help) Pin
Henry Minute26-May-10 4:08
Henry Minute26-May-10 4:08 
GeneralRe: Working with list(Please help) Pin
future383926-May-10 4:17
future383926-May-10 4:17 
GeneralRe: Working with list(Please help) Pin
Henry Minute26-May-10 4:24
Henry Minute26-May-10 4:24 
GeneralRe: Working with list(Please help) Pin
future383926-May-10 18:20
future383926-May-10 18:20 
Hi Every One,
I write this code and as you said I fixed it up(Follow your instruction).
but I got a problem
Error1: Cannot implicitly convert type 'string' to 'System.Collections.Generic.List<Assignmnet2.ITECH3219Student>' C:\Assignmnet2\Frm_View.cs

Error2: 'Assignmnet2.BLL.Finalization.read()': not all code paths return a value C:\Assignmnet2\BLL\Finalization.cs

Error3: Since 'Assignmnet2.Student_Manipulation.ReadStudentFile()' returns void, a return keyword must not be followed by an object expression C:\Assignmnet2\DAL\Student_Manipulation.cs

this is the code which I have modified it.


class studentmanipulation which is in DAL
public void ReadStudentFile()
        {
            FileStream flstream = new FileStream("c:\\student.dat", FileMode.Open, FileAccess.Read);
            BinaryFormatter BnFrmt = new BinaryFormatter();
            List<ITECH3219Student> list = (List<ITECH3219Student>)BnFrmt.Deserialize(flstream);
            return list;
      }


------------------------------------

Class finalization which is in BLL

public string read()
       {
           Assignmnet2.Student_Manipulation read = new Assignmnet2.Student_Manipulation();
           read.ReadStudentFile();
       }


----------------------------
and Presentation Layer which is my form

private void Form1_Shown(object sender, EventArgs e)
       {
           Assignmnet2.BLL.Finalization ReadStudent = new Assignmnet2.BLL.Finalization();
           List<ITECH3219Student> studentList = ReadStudent.read();
           foreach (ITECH3219Student student in studentList)
               {
                    LstBox.Items.Add(student.Fr_name + " " + student.Sr_Name + " " + student.St_Id);
               }
       }

Questionreplace Winlogon Pin
einsteinmow26-May-10 1:35
einsteinmow26-May-10 1:35 
AnswerRe: replace Winlogon Pin
Simon P Stevens26-May-10 1:58
Simon P Stevens26-May-10 1:58 
AnswerRe: replace Winlogon Pin
Richard MacCutchan26-May-10 1:59
mveRichard MacCutchan26-May-10 1:59 
AnswerRe: replace Winlogon Pin
Dave Kreskowiak26-May-10 2:04
mveDave Kreskowiak26-May-10 2:04 
Questionread file Pin
tek 200926-May-10 1:17
tek 200926-May-10 1:17 
AnswerRe: read file Pin
Richard MacCutchan26-May-10 1:54
mveRichard MacCutchan26-May-10 1:54 
GeneralRe: read file Pin
tek 200926-May-10 2:45
tek 200926-May-10 2:45 
GeneralRe: read file Pin
Richard MacCutchan26-May-10 4:22
mveRichard MacCutchan26-May-10 4:22 
GeneralRe: read file Pin
tek 200926-May-10 4:28
tek 200926-May-10 4:28 
GeneralRe: read file Pin
Richard MacCutchan26-May-10 6:33
mveRichard MacCutchan26-May-10 6:33 
QuestionDatagridview moves to first column when selecting row(s) Pin
andrehoyer26-May-10 0:54
andrehoyer26-May-10 0:54 
AnswerRe: Datagridview moves to first column when selecting row(s) Pin
Peace ON27-May-10 0:09
Peace ON27-May-10 0:09 
QuestionMessage Removed Pin
26-May-10 0:30
MohammadAmiry26-May-10 0:30 
AnswerRe: How to serialize static members of a class? Pin
Dave Kreskowiak26-May-10 2:06
mveDave Kreskowiak26-May-10 2:06 
GeneralRe: How to serialize static members of a class? Pin
Henry Minute26-May-10 2:37
Henry Minute26-May-10 2:37 
GeneralRe: How to serialize static members of a class? Pin
MohammadAmiry26-May-10 3:07
MohammadAmiry26-May-10 3:07 
Questionmouse right click on a control in .net 2.0 Pin
prasadbuddhika26-May-10 0:14
prasadbuddhika26-May-10 0:14 

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.