223300-asp-net-with-c-select-command-with-gridview

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 223300-asp-net-with-c-select-command-with-gridview as PDF for free.

More details

  • Words: 707
  • Pages: 4
 

 

Tutorials

 

Resources

 

Forum

 

Reviews

  Communities  

Interview

 

Jobs

 

Projects

 

Training

 

Your Ad Here

Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members  | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing  | 

Ads by Google   ASP Net   ASP Net Templates   ASP Dotnet C#   Gridview

CodeSmith Code Generator

Template-driven. Easy to use. Your code. Your way. Faster!  CodeSmithTools.com/FreeDownload

Prizes & Awards

Ads by Google

Forums » .NET » ASP.NET »

Asp.net with c# ,select command with gridview... My Profile Sign In

Posted Date: 15 Sep 2009      Posted By: asha      Member Level: Silver     Points: 1   Responses: 2

Register AdSense Revenue

Hai, i am creating select command in the gridview . when i click the select command that particular row should display on the textbox(outside of gridview).. Active Members Today Lalji (56) seema (46) Ramaraj R (31) Last 7 Days Raj Geetaben ... (511) Gaurav Arora (380) Anuraj (376) more...

My program is: -------------- asp.cs -------protected void Gridview1_selectedindexchanged(object sender, EventArgs e) { //string a; string b = GridView1.SelectedRow.Cells[1].Text; // TextBox1.Text = GridView1.SelectedRow.Cells[1].Text; // a = TextBox1.Text; SqlConnection con = new SqlConnection("user ID=sa;password=systems;database=empbook;Data Source=VEDAS-24;"); con.Open(); string str = "select * from emp where EmployeeNo='" + b.Trim () + "'"; SqlDataAdapter da = new SqlDataAdapter(str, con); DataSet ds = new DataSet(); da.Fill(ds, "select"); if (ds.Tables[0].Rows.Count > 0) { TextBox1.Text = ds.Tables["select"].Rows[0]["EmployeeNo"].ToString(); TextBox2.Text = ds.Tables["select"].Rows[0]["EmployeeName"].ToString(); DropDownList1.Text = ds.Tables["select"].Rows[0]["Gender"].ToString(); TextBox4.Text = ds.Tables["select"].Rows[0]["DateTime"].ToString(); //alendar1.SelectedDate= ds.Tables["select"].Rows[0]["DateTime"].ToString(); TextBox3.Text = ds.Tables["select"].Rows[0]["Email"].ToString(); CheckBox1.Text = ds.Tables["select"].Rows[0]["status"].ToString(); GridView1.DataSource = ds.Tables[0]; } if (ds.Tables["select"].Rows[0]["status"].ToString() == "Active") { CheckBox1.Checked = true; } else { CheckBox1.Checked = false; } } how can i get the row of content in the textbox using select command regards asha

 

  Search

LDAP Client.NET Create LDAP applications in C#, VB.Net or ASP.Net in record time. www.ldapservices.com

Responses Author: greeny_1984    15 Sep 2009

Member Level: Diamond

Rating: 

     Points: 2

Hi, There are no of events in a gridview in which you can get access to select command event.You can use row command event to achieve your functionality.I suggest you not to disclose  your database settings in public. Regards, Greeny_1984 Rate this Response[Excellent/Good/Poor] FRESHERS check this link Need help from me join here

Author: Syed Shakeer Hussain     15 Sep 2009

Hi asha, Try the following example code using selectd command

Member Level: Diamond

Rating: 

     Points: 2

How to create a' select 'link column in Gridview :-----------------------------------------------'Select' Link

can be build by using 'CommandField' as follows:

Next Select your Gridview Events.Double click on SelectedIndexChanged Event and write the Below code protected void Gridivew1_SelectedIndexChanged(object sender, EventArgs e) { string strValue2 = ((Label)Gridivew1.SelectedRow.Cells[1].FindControl("lblProductName1")).Text ; Response.Write(product=" + strValue2+"); } Dont

forget to give rating

Thanks & Regards! Syed Shakeer Hussain

Post Reply You must Sign In to post a response.

Next : Crystal reports asking username password while oading Previous : Server error in '/' application.

Related Messages

Return to Discussion Forum Post New Message Category: ASP.NET



Validation Controls



no of click on advertisement in asp.net application



Please Please help.................. tooo urgent



Please tell me .Net interview Questions for 2+ Years Exp



To upload Documents like(doc,pdf,etc) to file system

in .asp.cs page:

Database applications in minutes! Generate data entry and reporting .NET Web apps in  minutes, straight from your database. Visually stunning,  easy to customize and ready to deploy. Download Now! 

Scrum Project Management - 1 User FREE dotNet Slackers Get the tool that sprints as fast as your team. Burndown  charts, sprint tracking, workflow, users and project manager  dashboards. Free for 1 user. 30-day trials for teams.  Download OnTime 2009 >>

About Us    Contact Us    Privacy Policy    Terms Of Use