Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am new to this so please be kind! I am working with C# and want to be able to select a row from gridview
I am new to this so please be kind! I am working with C# and want to be able to select a row from gridview (returned to TextBox1) and run this sql query:
Select grade1.Grade, grade1.Date FROM dbo.grade1 WHERE grade1.Host = ( TextBox1.Text) ORDER BY grade1.Date
I don't mind if the output is in a new page or a text box on the same page. Please Help!
using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication2 { public partial class Domain : System.Web.UI.Page { SqlConnection con = new SqlConnection(my connection String...); protected void Page_Load(object sender, EventArgs e) { } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = GridView1.SelectedRow; TextBox1.Text = row.Cells[1].Text; } } }
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