top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

I am getting started with c# can someone share tips and tricks?

0 votes
152 views
I am getting started with c# can someone share tips and tricks?
posted Apr 27, 2017 by Leon Martinović

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

You can start learning the basics of C# and .NET fundamentals.

You can start with basic fundamentals and can move to advanced topics like delegates ,generics ,lists and all. But first you can start with what are advantages of C# and how it is different from other languages. Later you can start writing small codes which will include some arithmetic operations.This will bring you some confidence in you and makes you familiar with the code.
You can check on net for various tutorials on C# and can start learning it.

answer May 3, 2017 by Shweta Singh
Similar Questions
+1 vote

If write this code in form 1 :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Xml.Serialization;

namespace PostLab5_**********
{
    public partial class Form1 : Form
    {
        List<StudentInfo> Stu_Info = new List<StudentInfo>();
        Queue<StudentInfo> pass = new Queue<StudentInfo>();
        Queue<StudentInfo> fail = new Queue<StudentInfo>();
        Stack<StudentInfo> Excelent = new Stack<StudentInfo>();
        Stack<StudentInfo> VeryGood = new Stack<StudentInfo>();
        Stack<StudentInfo> Good = new Stack<StudentInfo>();
        public Form1()
        {
            InitializeComponent();
        }

        private void importXMLToolStripMenuItem_Click(object sender, EventArgs e)
        {

            OpenFileDialog Dlg = new OpenFileDialog();
            Dlg.Filter = "XML File|*.xml";
            if (Dlg.ShowDialog() == DialogResult.OK)
            {
                StreamReader Infile = new StreamReader(Dlg.FileName);
                XmlSerializer Des = new XmlSerializer(typeof(List<StudentInfo>));
                Stu_Info = (List<StudentInfo>)Des.Deserialize(Infile);
                Infile.Close();
                dataGridView1.DataSource = Stu_Info;
            }
        }

        private void passedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var R = from Item in Stu_Info
                    where Item.total >= 50
                    select Item;
            dataGridView1.DataSource = R.ToArray();
            foreach (StudentInfo item in R)
            {
                pass.Enqueue(item);
            }
        }

        private void failedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var R = from Item in Stu_Info
                    where Item.total < 50
                    select Item;
            dataGridView1.DataSource = R.ToArray();
            foreach (StudentInfo item in R)
            {
                fail.Enqueue(item);
            }
        }

        private void excellentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var R = from Item in Stu_Info
                    where Item.total >= 84
                    select Item;
            dataGridView1.DataSource = R.ToArray();
            foreach (StudentInfo Item in R)
            {
                Excelent.Push(Item);
            }
        }

        private void veryGoodToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var R = from Item in Stu_Info
                        where Item.total >=76 && Item.total <84
                        select Item;
                dataGridView1.DataSource = R.ToArray();
                foreach (StudentInfo Item in R)
                {
                    VeryGood.Push(Item);
                }
            }

        private void goodToolStripMenuItem_Click(object sender, EventArgs e)
        {
             var R = from Item in Stu_Info
                        where Item.total >= 68 && Item.total < 76
                        select Item;
                dataGridView1.DataSource = R.ToArray();
                foreach (StudentInfo Item in R)
                {
                    Good.Push(Item);
                }
        }

        private void countOfVeryGoodToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show(VeryGood.Count().ToString());
        }

        private void peekOfPeekToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show(Good.Peek().name);
        }

        private void removeItemFromFailedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show(fail.Dequeue().name);
        }

        private void countOfPassedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show(pass.Count().ToString());
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 f2 = new Form2();

        }
        }
    }

and in form2 contain textboxes to add new item for these list ! how use this !

...