Hello Chris,
thank you for your response. Unfortunately, since the data structure might be different in
different files, the DataSet may not be a typed one.
Nevertheless, it is always good to know more... :)
Pavel
Chris Bordeman napsal(a):
[quoted text, click to view] > If it's a 2.0 typed dataset you can use Rows[0].Fieldname = "something";
>
> Provides type safety and more convenient. Use the Data-->Add new data
> source wizard.
>
> "Pavel Maly" <account@domain.com> wrote in message
> news:u4Byoyp%23GHA.3456@TK2MSFTNGP02.phx.gbl...
>> Well, another thorough googling revealed a method which seems to work
>> fine:
>>
>> dataSet.Tables["tbl"].Rows[0][colIdx] = "something";
>>
>> Nevertheless, in case anyone knows a better method, I'll be glad to know
>> it too... :)
>>
>> Pavel
>>
>>
>>
>> Pavel Maly napsal(a):
>>> Hello everyone,
>>> as a beginner I've encountered a problem while trying to change a value
>>> inside the DataSet.
>>> After I call
>>>
>>> dataSet.Tables["tbl"].Rows[0].ItemArray.SetValue("something", colIdx);
>>>
>>> the value in the row 0 and column colIdx of the DataTable "tbl" doesn't
>>> get changed.
>>>
>>> The thing is I need to change a few values after loading the database
>>> file data into the DataSet
>>> and, as I've read somewhere, it is necessary to change the data in the
>>> DataSet, then set the
>>> DataSource property to null and reassign it again to see the changed
>>> values. I've tried to
>>> change the content of data-bound controls directly, but that didn't work
>>> every time (it failed,
>>> for instance, in case the control was on a TabPage which was not
>>> selected).
>>>
>>> How should I change the value correctly then?
>>>
>>> TIA
>>>
>>> Pavel
>
If it's a 2.0 typed dataset you can use Rows[0].Fieldname = "something";
Provides type safety and more convenient. Use the Data-->Add new data
source wizard.
[quoted text, click to view] "Pavel Maly" <account@domain.com> wrote in message
news:u4Byoyp%23GHA.3456@TK2MSFTNGP02.phx.gbl...
> Well, another thorough googling revealed a method which seems to work
> fine:
>
> dataSet.Tables["tbl"].Rows[0][colIdx] = "something";
>
> Nevertheless, in case anyone knows a better method, I'll be glad to know
> it too... :)
>
> Pavel
>
>
>
> Pavel Maly napsal(a):
>> Hello everyone,
>> as a beginner I've encountered a problem while trying to change a value
>> inside the DataSet.
>> After I call
>>
>> dataSet.Tables["tbl"].Rows[0].ItemArray.SetValue("something", colIdx);
>>
>> the value in the row 0 and column colIdx of the DataTable "tbl" doesn't
>> get changed.
>>
>> The thing is I need to change a few values after loading the database
>> file data into the DataSet
>> and, as I've read somewhere, it is necessary to change the data in the
>> DataSet, then set the
>> DataSource property to null and reassign it again to see the changed
>> values. I've tried to
>> change the content of data-bound controls directly, but that didn't work
>> every time (it failed,
>> for instance, in case the control was on a TabPage which was not
>> selected).
>>
>> How should I change the value correctly then?
>>
>> TIA
>>
>> Pavel