I have a datatable that has been created from a new row in a datagrid.
There is a field that is defined in the datatable that is NOT displayed in
the datagrid (key field), although the column IS defined in the datatable.
I want to force a value into the column before I update the dataAdapter.

How do I do this?

TIA,

Larry Woods

Re: How do I force a value into a datatable column? by W

W
Sun Nov 14 20:30:09 CST 2004

Larry -- you can just reference the underlying row like
TableName.Rows[0][ColumnIndex] = Whatever;

If you want though, specify a defaultValue of the datacolumn, then you'll
have it as soon as you add the row - provided you know what you want it to
be.

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Larry Woods" <larry@NOSPAMlwoods.com> wrote in message
news:##MlnZmyEHA.908@TK2MSFTNGP11.phx.gbl...
> I have a datatable that has been created from a new row in a datagrid.
> There is a field that is defined in the datatable that is NOT displayed in
> the datagrid (key field), although the column IS defined in the datatable.
> I want to force a value into the column before I update the dataAdapter.
>
> How do I do this?
>
> TIA,
>
> Larry Woods
>
>



Re: How do I force a value into a datatable column? by Larry

Larry
Mon Nov 15 12:43:51 CST 2004

Thanks.

Missed the obvious...!

Larry

"W.G. Ryan eMVP" <WilliamRyan@NoSpam.gmail.com> wrote in message
news:Oh9MVqryEHA.3996@TK2MSFTNGP10.phx.gbl...
> Larry -- you can just reference the underlying row like
> TableName.Rows[0][ColumnIndex] = Whatever;
>
> If you want though, specify a defaultValue of the datacolumn, then you'll
> have it as soon as you add the row - provided you know what you want it to
> be.
>
> --
> W.G. Ryan MVP (Windows Embedded)
>
> TiBA Solutions
> www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
> "Larry Woods" <larry@NOSPAMlwoods.com> wrote in message
> news:##MlnZmyEHA.908@TK2MSFTNGP11.phx.gbl...
> > I have a datatable that has been created from a new row in a datagrid.
> > There is a field that is defined in the datatable that is NOT displayed
in
> > the datagrid (key field), although the column IS defined in the
datatable.
> > I want to force a value into the column before I update the dataAdapter.
> >
> > How do I do this?
> >
> > TIA,
> >
> > Larry Woods
> >
> >
>
>