Hi
I bind the data in textbox in the gridview from the SQL table. in that i gonna edit only one textbox using edit and delete option.
so i gonna edit the valuer in the textbox,its should not greater than old value.i can able to do that in table method,bt nt in gridview.
it should editable as per the user values.its not constant value,it ll change as the username,Id
ex:
public partial class f : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("data source=VAAYUSEVA_SVR;Initial Catalog=cppsch;User ID=sa;Password=sa");
public static string x;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string un = Session["Uname"].ToString();
string q = "select * from TBL_CPPMASTER where [USER NAME]='" + un + "'";
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cppschConnectionString"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand(q, con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtBigNumber.Text = dr["CPPQUANTUM_C"].ToString();
}
}
}
for grid view: btis nt wrking:
AutoGenerateColumns="false" ShowFooter="true" HeaderStyle-Font-Bold="true"
onrowcancelingedit="gridView_RowCancelingEdit" DataKeyNames="Id"
onrowdeleting="gridView_RowDeleting" HeaderStyle-BackColor="#E9E9E9"
onrowediting="gridView_RowEditing"
onrowupdating="gridView_RowUpdating"
onrowcommand="gridView_RowCommand"
OnRowDataBound="gridView_RowDataBound" style="margin-left: 0px" >
please help me...i need exact code.....
2 Replies
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.
Kamala VeniPosted Jul 8, 2016, 5:05 AM
kalu singh raoPosted Jul 8, 2016, 4:31 AM