File manager - Edit - G:/PleskVhosts/indiaminerals.in/vgm.INFOFIXDEVELOPERS.COM/admin/Death_list.aspx.cs
Back
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; using WebApp.LIBS; namespace VGM.admin { public partial class Death_list : BasePageClass { string cs = ConfigurationManager.ConnectionStrings["gav"].ConnectionString; SqlDataAdapter da1; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { da1 = new SqlDataAdapter("select * from death", cs); DataTable dt1 = new DataTable(); da1.Fill(dt1); Gridview1.DataSource = dt1; Gridview1.DataBind(); } } protected void show_Click(object sender, EventArgs e) { try { string cs = ConfigurationManager.ConnectionStrings["gav"].ConnectionString; string query = "SELECT Death_id, Tag_no, Date, Time, Reason FROM death WHERE Date BETWEEN @FromDate AND @ToDate"; using (SqlConnection connection = new SqlConnection(cs)) { connection.Open(); SqlCommand cmd = new SqlCommand(query, connection); // Convert the text from the TextBoxes to DateTime objects DateTime fromDate = DateTime.Parse(From.Text); DateTime toDate = DateTime.Parse(To.Text); cmd.Parameters.AddWithValue("@FromDate", fromDate); cmd.Parameters.AddWithValue("@ToDate", toDate); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); Gridview1.DataSource = dt; Gridview1.DataBind(); } } catch(Exception ex) { Response.Write("<script>alert('An error occurred: " + ex.Message + "')</script>"); } } } }
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings