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

DataGrid data retreival

I'm trying to retreive data from DataGrid on my form and update dataset.
Problem is that it returns data without my changes.
((TextBox)e.Item.Cells[0].Controls[0]).Text; returns
unchanged values. Strange..

Here is where I'm calling it from :
private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)

{

string key=DataGrid1.DataKeys[e.Item.ItemIndex].ToString();

DataSet1.EmployeesRow r;

r=DataSet1.Employees.FindByEmployeeID( Int32.Parse( key ) );
r.FirstName = ((TextBox)e.Item.Cells[0].Controls[0]).Text;

r.LastName = ((TextBox)e.Item.Cells[1].Controls[0]).Text;

sqlDataAdapter1.Update( DataSet1 );

sqlDataAdapter1.Fill( DataSet1);

DataGrid1.EditItemIndex=-1;

DataGrid1.DataBind();

}
Nov 18 '05 #1
2 927
Prigozhin Roman wrote:
sqlDataAdapter1.Update( DataSet1 );

sqlDataAdapter1.Fill( DataSet1);


Where's the call to AcceptChanges()? And why are you refilling your
DataSet? That step should be unnecessary.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Nov 18 '05 #2
BTW, I recently came across a similar problem. I solved mine by calling
DataRow.BeginEdit(), making my changes, calling DataRow.EndEdit() and
updating the database through a DataAdapter.
--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Nov 18 '05 #3

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

Similar topics

2
by: Michael T. Peterson | last post by:
Hi, I am new to WEB design (and Javascript programming in particular) so I apologize if this is already a FAQ. Anyway, I need to retrieve data available on another server (and then incorporate...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
4
by: danielduq | last post by:
Hey everyone, This is my first post here - so I'm not sure I'll phrase this question right, but here goes: I need to create a Visual Basic 6 program to automate a login to a web site and then...
34
by: vectorBS | last post by:
I am facing a serious issue. The current data appears as follows and in entered in the same manner. Garment Style Size Total Qty UCPJ 1 32 12 UCPJ 1 30 55 UCT 1 S 25 UCT 1 L 100
0
by: makTSPL | last post by:
Dear All, I am developing an application in C#. This application communicates with Garmin Forerunner device. I have developed a demo for it, which shows Device software version. but I am not able to...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.