Showing posts with label data store in sql server data base. Show all posts
Showing posts with label data store in sql server data base. Show all posts

Saturday, July 28, 2018

how to create Student Database management system | sradha webcreations

Student Database management system in asp.net  Sql Server


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Security;


public partial class IF_ELSE_AND_OR_PERCENTAGE : System.Web.UI.Page
{ 
    protected void TextBoxTOTALMARKS_TextChanged1(object sender, EventArgs e)
    {
        string sName = TextBoxNAME.Text;
        double dTotalMark =Convert.ToDouble( TextBoxTOTALMARKS.Text);
        double dpercentages;
       
        dpercentages=(dTotalMark/1000)*100;
        TextBoxPERCENTAGE.Text=Convert.ToString(dpercentages);
        string sGrade;
       
        if(dpercentages>=60)
        {
            sGrade="A";
        }
         else if(dpercentages>=50 && dpercentages<60)
        {
            sGrade="B";
        }
        else if(dpercentages>=40 && dpercentages<50 )
        {
            sGrade="C";
        }
        else
        {
            sGrade="F";
        }
        TextBoxGRADE.Text=Convert.ToString(sGrade);
        }}




Monday, July 23, 2018

how to calculate area and save the data in data base | Sradha WebCreations



how to calculate area & save the data in database



Enter Width
Enter Heigh
Area is


using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class AreaRectangle : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        float fWidth;
        float fHeight;
        float fArea;

        fWidth = Convert.ToInt64(txtWidth.Text);
        fHeight = Convert.ToInt64(txtHeight.Text);

        fArea = (fWidth * fHeight);

        txtArea.Text = Convert.ToString(fArea);
   
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        string connectionString = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
        string insertSql = "INSERT INTO AreaOfRect(rwidth,rheight,rarea) VALUES(@rwidth, @rheight,@rarea)";

 using (SqlConnection myConnection = new SqlConnection(connectionString))
        {
            myConnection.Open();
    SqlCommand myCommand = new SqlCommand(insertSql, myConnection);
      myCommand.Parameters.AddWithValue("@rwidth", txtWidth.Text);
      myCommand.Parameters.AddWithValue("@rheight", txtHeight.Text);
         myCommand.Parameters.AddWithValue("@rarea", txtArea.Text);

            myCommand.ExecuteNonQuery();
            myConnection.Close();
        }

        // "Reset" the Subject and Body TextBoxes
        txtWidth.Text = string.Empty;
        txtHeight.Text = string.Empty;
        txtArea.Text = string.Empty;

    }
}

#SradhaWebCreations
Contact : +91-9040573923, +91-7008182025
http://sradhawebcreations.com/
http://sradhawebcreations.blogspot.in/
https://facebook.com/sradhawebcreations