Friday, March 28, 2014

How to Add Two Values Using C# with asp.net visual studio .

Please See In Bellow :
If you want to adding two values then you can see in bellow .You can also perform subtraction, multiplication and division. you will change the main logic , here the main logic is result = firstValue + secondvalue .Then you only changed the operator. Then you can perform .By Syed Sohel .

The Graphical View :



The Code :


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;

namespace Show_String
{
    public partial class Adding_Values : Form
    {
        public Adding_Values()
        {
            InitializeComponent();
        }

        private void addButton_Click(object sender, EventArgs e)
        {
            double firstValue, secondvalue, result;

            firstValue = Double.Parse(firstValueTextBox.Text);
            // here we can also use anotheb formate like as:                      Convert.ToDouble(firstValueTextBox.Text);
            secondvalue = Double.Parse(secondValueTextBox.Text);
            result = firstValue + secondvalue;
            resultValueTextBox.Text = result.ToString();


        }
    }
}

Thursday, March 27, 2014

How to Show a String in Messagebox using C# with asp.net visual studio .

If we want to show string in massage box please see bellow :
The Graphical View : 
The Coding :

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;

namespace Show_String
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void showButton_Click(object sender, EventArgs e)
        {
            string showString;
            showString = stringTextBox.Text;
            MessageBox.Show(showString);
        }
    }
}