Grid View in ASP.NET
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; public partial class _Default : System.Web.UI.Page
{ SqlConnection con; SqlCommand cmd string str; SqlDataAdapter ad; protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection ("Data Source =server name;Initial Catalog=Database Name";User ID= User;Password = your PasswordRecovery"); con.Open(); Response.Write("connect"); } protected void Button1_Click(object sender, EventArgs e) { str = "select * from empinfo where name ='"+TextBox1.Text+"' ,address = '"+TextBox2.Text+"',email_id ='"+TextBox3.Text+"'"; ad =new SqlDataAdapter (str,con); GridView1.DataSource =ds.tables [empinfo].defaultview; GridView1.DataMember ="empinfo"; GridView1 .DataBind (); }
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: