473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Data grid updation

In my code i am not able to get the new value from thre textbox which got created when we click the edit button. IT is taking the value which is retried from the database. please help...

Expand|Select|Wrap|Line Numbers
  1. protected void qltyGrid_EditCommand(object source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
  2.     {
  3.         qltyGrid.EditItemIndex = e.Item.ItemIndex;
  4.         BindData();
  5.     }
  6. protected void qltyGrid_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
  7.     {
  8.         string cName = ((TextBox)e.Item.Cells[1].Controls[0]).Text;
  9.  
  10.         ShowMsg(cName);
  11.         SqlCommand com = new SqlCommand("update QualityMasters set QltyName='" + cName  + "' where QltyId='" + 2 + "';", con);
  12.         con.Open();
  13.         com.ExecuteNonQuery();
  14.         con.Close();
  15.         qltyGrid.EditItemIndex = -1;
  16.         BindData();
  17.     }
Sep 25 '08 #1
2 985
Frinavale
9,735 Expert Mod 8TB
In your Page Load event....are you performing a DataBind on your GridView?

When you do this all the data that has been entered during editing is deleted...because the data source has been switched. This could be the reason why you cannot retrieve the text from the edit text box.

-Frinny
Sep 25 '08 #2
yes it is true. that was the problem. from yesterday i am breaking my head.
thanks a lot.
Sep 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Lakshmi Narayanan.R | last post by:
Hi Experts I am new to .NET. I need great explanation for "the updation in the disconnected data". How it is handled. That is, if mutiple user is interacting with the data, one will delete another...
0
by: prashant | last post by:
Hi, I am trying to set up Transactional replication with immediate updation. The configuration is as follows: 1. Publisher is SQL server 2000 Enterprise Edition, and Distributor is on the...
0
by: smasadhaque | last post by:
We are using a third party control C1FlexGrid to display the real time data. The data is received from a server on a different thread, processed and then stored in a dataset table. This table is...
1
Shanaj
by: Shanaj | last post by:
hello I am using a datagrid with 2 coloums.I want to do validation in 2nd column. and how to do updation in datagrid
1
by: vvasnm | last post by:
Hi This is surya, I am struggling with one issue regarding the updation of the value in the sub form ,when the related data has been deleted from the data sheet view of the main form. I am...
2
by: ren07 | last post by:
i want insert the data into the database through datagrid, how i can possible that..each time a new data must be inserted through datagrid..plzzz anyone help to get that
1
by: roshan56us | last post by:
Hi, i have problem in updation of access database, which is in backend and Visual basic as front end. its using 800 records in MS-Access but,while updating the database, it doesn't update sometime...
2
by: mcaamit | last post by:
I want to update a row in grid view using Bound column my code is like this :::But it does`nt work int iRowIndex = e.RowIndex; string sOrderNo = GridView1.Rows.Cells.Text; ...
1
by: siri11 | last post by:
Hi everyone!!!!!!!!! If i update a record in a table in sqlserver from front end (c#.net),using a stored procedure for updating then after updation if i open the table then it is showing the same...
2
by: sweatha | last post by:
Hi In my home page I have the login form & the link button named "Update Profile?". If I click that link button, then it redirects to the page which has the Profile Updation Process which includes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.