473,387 Members | 1,440 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.

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 3459
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: 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...
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
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.