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

DataSet Problem

Can anyone tell me why this doesn't work

ds.Tables[0].Rows[0].ItemArray[TITLE] = m_sTitle;

Nov 16 '05 #1
4 3457
Try this,

ds.Tables[0].Rows[0]["TITLE"] = m_sTitle;

I replaced your TITLE with "TITLE" because I assumed that was the actual
name of the column.

HTH
--
Lateralus [MCAD]

"NewGuy" <a@a.com> wrote in message
news:u8**************@TK2MSFTNGP10.phx.gbl...
Can anyone tell me why this doesn't work

ds.Tables[0].Rows[0].ItemArray[TITLE] = m_sTitle;

Nov 16 '05 #2
Hi NewGuy,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you're trying to modify a cell's value
using ds.Tables[0].Rows[0].ItemArray[TITLE] = m_sTitle. However, this
doesn't work. If there is any misunderstanding, please feel free to let me
know.

This doesn't work, because the ItemArray property returns another instance
of values of that row. So when you assign value to that array, actually
you're not modifying the DataRow object but another instance of object
array. So the changes cannot be seen from the DataSet. You can try to
following instead:

ds.Tables[0].Rows[0][TITLE] = m_sTitle;

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3
You could either set the values as suggested, or set the whole Array
together. Check out this page in MSDN
http://msdn.microsoft.com/library/de...arraytopic.asp

"NewGuy" wrote:
Can anyone tell me why this doesn't work

ds.Tables[0].Rows[0].ItemArray[TITLE] = m_sTitle;

Nov 16 '05 #4
Thanks Kevin,

That did the trick. Thanks to everyone else for sugestions as well.

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:6V**************@cpmsftngxa10.phx.gbl...
Hi NewGuy,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you're trying to modify a cell's value
using ds.Tables[0].Rows[0].ItemArray[TITLE] = m_sTitle. However, this
doesn't work. If there is any misunderstanding, please feel free to let me
know.

This doesn't work, because the ItemArray property returns another instance
of values of that row. So when you assign value to that array, actually
you're not modifying the DataRow object but another instance of object
array. So the changes cannot be seen from the DataSet. You can try to
following instead:

ds.Tables[0].Rows[0][TITLE] = m_sTitle;

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #5

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

Similar topics

6
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
2
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
2
by: theWizK | last post by:
Hello all. I have noticed that when I generate a strongly-typed dataset from an xml schema that the DataTables that are generated have their constructors marked as internal. What this means is...
4
by: Joerg M. Colberg | last post by:
Hi all, I have a problem when using a DataSet. I am using it to query a SQLServer database as follows. In my code it looks like SqlDataAdapter eDA = new SqlDataAdapter(sqlcmd); // where...
2
by: Dennis | last post by:
Hi, I am hoping I can get some help with a small problem I have run into using C#. U have an XML file that I load into a Dataset and then display this in a Datagrid. No problems doing this at all....
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
0
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create...
2
by: Carl Summers | last post by:
I have a table in an Access database that has no sort applied in Access. When I fill a dataset with data from that table (the entire one dimensional table) my dataset is sorted differently than...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
8
by: Harry Strybos | last post by:
Visual Studio 2005 - SP1 - VB.Net on WinXP SP2 I add a typed dataset to my solution and get the following errors : Error 1 sub 'ReadXmlSerializable' cannot be declared 'Overrides' because it...
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: 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...
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: 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...

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.