473,616 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3480
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******** ******@TK2MSFTN GP10.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 misunderstandin g, 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.mic rosoft.com> wrote in message
news:6V******** ******@cpmsftng xa10.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 misunderstandin g, 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
2242
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 returned as DataSet. Now, here's the problem. On .NET Framework 1.1, if any rows in the dataset returned contain errors (marked by calling the SetColumnError() method or
2
2015
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 returned as DataSet. Now, here's the problem. On .NET Framework 1.1, if any rows in the dataset returned contain errors (marked by calling the SetColumnError() method or
2
2870
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 when I try to instantiate one of the strongly-typed tables from this dataset from a different assembly, I cannot. Let me provide examples... If I have a simple dataset like this:
4
870
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 sqlcmd is a SQL String DataSet ds = new DataSet(); eDA.fill(ds);
2
5337
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. I then use a Dataview to filter this view using a keyword and I have no problems with this either. What I would like to do is to save this Dataview to a new Dataset so I can save the reslts to a new file but here is where I am having the...
22
25575
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 compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet = ws.VerifySku(cartSet)
0
2581
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 tablestyles to format any of the columns within the datagrid, the exception "Can-not parent objects created on one thread to objects created on another" or words to that effect. I'm not too sure if what I said make sense, but i will add details to...
2
3694
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 the database. This would not be a problem, and really isn't a problem except that it means I have to search the dataset each time I want to find a particular record instead of just storing a variable. Which brings me to a different question....
17
2747
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 allow user to filter the first time, when they tried the second time, the speficied cast error message will prompt one.... I create a mydataset1 first, and the mydataset1 data source was getting from DataGrid.DataSource.
8
1983
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 does not override a sub in a base class. C:\AAProjects.Net\TRM8\TRM8.UI\Reports\BillingReport.Designer.vb 125 29 TRM8.UI Error 2 'Protected Overrides Function GetSchemaSerializable() As
0
8203
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8146
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8592
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8297
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4063
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.