I think I got it!!! I solved this one myself!!! After moving somethings around and trying them out I got it. I also had to remove the TextBox_Text change. This is the code I did.
using System;
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;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Configuration;
using System.Drawing.Printing;
using System.IO;
using System.Web.SessionState;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
namespace SACSCOCLogin1._1
{
public partial class TestCal : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HotConnectionString"].ConnectionString);
con.Open();
SqlCommand scmd = new SqlCommand("Select Cars, Trucks from TestCal", con);
SqlDataReader dr = scmd.ExecuteReader();
if (dr.Read())
{
TextBox1.Text = dr["Cars"].ToString();
TextBox2.Text = dr["Trucks"].ToString();
}
dr.Close();
con.Close();
{
int a = Convert.ToInt32(TextBox1.Text);
int b = Convert.ToInt32(TextBox2.Text);
TextBox3.Text = Convert.ToString(a + b);
}
}
}
}