Question
(Web App development with ASP.NET in C#) Create a web-based Address book. Display the address books contents in a GridView. Allow the user to search
(Web App development with ASP.NET in C#) Create a web-based Address book. Display the address books contents in a GridView. Allow the user to search for entries with a particular last name. Trying to do this and I get multitude of errors, any help will be appreciated, thank you!
The default.aspx code is:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;
namespace MyWebForm { public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e) {
} private void rep_bind() { connection(); string query = "select * from customer where Name like'" + TextBox1.Text + "%'";
SqlDataAdapter da = new SqlDataAdapter(query, con); DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { if (dr.HasRows) } dr.Read();
rep_bind(); GridView1.Visible = true;
TextBox1.Text = ""; Label1.Text = ""; } else { GridView1.Visible = false; Label1.Visable = true; Label1.Text = "The search Term " + TextBox1.Text + " Is Not Available in the Record"; }
The Default.aspx.designer code is:
//------------------------------------------------------------------------------ //
namespace MyWebForm { public partial class _Default { ///
The database is a sql and is connected already to the table as seen here:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started