protected void TextBoxNCC_TextChanged(object sender, EventArgs e) { SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["HotConnectionString"].ConnectionString); con.Open(); if (true) { SqlCommand level = new SqlCommand("Select INST_ID, Calendar from Table44 where INST_ID = @INST_ID", con); level.Parameters.Add(new SqlParameter("INST_ID", TextBoxINST_ID.Text)); SqlDataReader reader = level.ExecuteReader(); DataTable dt1 = new DataTable(); dt1.Load(reader); foreach (DataRow dr1 in dt1.Rows) { string returnedLevel = (dr1[0].ToString()); int inst_id = Convert.ToInt32(dr1[2].ToString()); Session["inst_id"] = inst_id; if (returnedLevel == "Semester") { int i = Convert.ToInt32(TextBoxNCC.Text); int j = 168; TextBoxNCCDR.Text = Convert.ToString(i / j); } else if (returnedLevel == "Quarter") { int i = Convert.ToInt32(TextBoxNCC.Text); int j = 120; TextBoxNCCDR.Text = Convert.ToString(i / j); } } } } }
<td class="style27"> <asp:TextBox ID="TextBoxNCC" runat="server" Width="180px" ontextchanged="TextBoxNCC_TextChanged" AutoPostBack="True"></asp:TextBox> </td>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)