File manager - Edit - G:/PleskVhosts/indiaminerals.in/vgm.INFOFIXDEVELOPERS.COM/admin/Reg_Allreport.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 Reg_Allreport : BasePageClass { string cs = ConfigurationManager.ConnectionStrings["gav"].ConnectionString; SqlDataAdapter da1; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { da1 = new SqlDataAdapter("select id, Tag_no, animal_category, species, age,owner_name,owner_mobile_no from registration ", 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 id, Tag_no, animal_category, species, age,owner_name,owner_mobile_no,status FROM registration 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>"); } } protected void View_Command(object sender, CommandEventArgs e) { if (e.CommandName == "View") { string tagNo = e.CommandArgument.ToString(); // Assuming 'animal_detailmaster.aspx' is the target page Response.Redirect("animal_detailmaster.aspx?tag_no=" + tagNo); } } } }
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.07 |
proxy
|
phpinfo
|
Settings