473,387 Members | 1,619 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,387 software developers and data experts.

Edit a record in a datgrid : Having to reload the data

Hi All

I have a datagrid which takes it's data from a table on
a remote i-series. This datagrid is loaded on Page Load
and the user is able to select a record to edit by pressing
the appropriate button. No problem so far.

The problem comes in that I appear to have to reload the
data into the datagrid before placing it into editstate.

string LSqlString;
LSqlString = "Select * From ICOSF.LIVLEADTIM";
con.Open();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = LSqlString;
OleDbDataReader dsLivery = cmd.ExecuteReader();
Livery.DataSource = dsLivery;
Livery.EditItemIndex = e.Item.ItemIndex;
Livery.DataBind ( );
con.Close();

This is fine and works. However the problem comes into play in the
following scenario

1. The page loads and reads the table and populates the datagrid.
2. Someone else deleted a record from the source table via some
other process. This record is still visible in the loaded datagrid.
3. My user selects that particular record for editing.
4. The data load is fired off again and the datagrid is placed into
edit mode
this time with the wrong record highlighted for editing - down to
the
selected ItemIndex of the record selected of the original
datagrid.

Anyone have any ides about how I oversome this problem.

Thanks in advance for any help offered

Iain

Jan 10 '07 #1
0 1088

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
25
by: dixie | last post by:
I have some code that adds new records into a table for each ID in a list box when a button on a form is clicked. This works fine. My problem now is that I wish to be able to edit all the records...
0
by: Mike | last post by:
Hi, I am having problems with my program, the problem is it will not put the datagrid into edit mode. The .aspx page has the following code in it : - <asp:datagrid id="DataGrid2"...
2
by: Gary | last post by:
Hello All, I have an editable data grid in my web form, this grid allows the user to add new records, edit existing records and also delete them. When a user adds a record the grid goes in to...
1
by: peg | last post by:
I have an app that i need to create a way for a user to either add or edit records that have a good 50 fields. Due to the large amount of fields I can't just use a Datagrid and use the edit...
2
by: P. Yanzick | last post by:
Hello, I am creating an edit template for a FormView control, changing one of the textboxes to a dropdown box. The dropdown will be populated from a simple table with the primary key, and a...
9
bhcob1
by: bhcob1 | last post by:
Hey guys, 'Update or CancelUpdate without AddNew or Edit' On my database i keep occasionly get this error when i try and edit a field, it is not everytime. It will be working fine and then this...
8
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit...
0
by: sumitdipsite2005 | last post by:
I am trying to use VB6 as a middleware between two 3rd party applications. "App. A" ----> VB6 ------> "App B" i am having no trouble sending data from VB to the "App B". But i am having...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.