Hi yaar I am jelpless kindly help me....
I am waiting for your reply....
Asp.net using c# codings
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Mar 21, 2013, 4:34 AM
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace Gridview
{
public partial class _Default : System.Web.UI.Page
{
string connStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlCommand com;
SqlDataAdapter sqlda;
DataSet ds;
string str;
protected void Page_Load(object sender, EventArgs e)
{
bindgrid();
}
private void bindgrid()
{
SqlConnection con = new SqlConnection(connStr);
con.Open();
str = "select * from employee";
com = new SqlCommand(str, con);
sqlda = new SqlDataAdapter(com);
ds = new DataSet();
sqlda.Fill(ds, "employee");
g1.DataMember = "employee";
g1.DataSource = ds;
g1.DataBind();
con.Close();
}
}
}
Anurag SarkarPosted Mar 21, 2013, 3:26 AM
You should Try this:-
protected void Itemsearchgrid_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
txtplno.ReadOnly = true;
txtplno.Text = Itemsearchgrid.SelectedRow.Cells[1].Text.ToString();
txtdescp.Text = Itemsearchgrid.SelectedRow.Cells[2].Text.ToString();
txtaac.Text = Itemsearchgrid.SelectedRow.Cells[8].Text.ToString();
Txtrmrks.Text = Itemsearchgrid.SelectedRow.Cells[11].Text.ToString();
fromyearlist.SelectedIndex = 0;
}
catch(Exception ex)
{}
}