Re: Can't edit a field in a dataset by William
William
Wed Oct 29 14:28:51 CST 2003
Sure. This is "by design". Computed expressions are, by default not
updatable.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Don" <unknown@oblivion.com> wrote in message
news:myUnb.217271$9l5.54046@pd7tw2no...
> I'm not 100% sure what you mean by "typed dataset", and I don't know
> anything about XSD files or dragging queries into dataset design surfaces.
> Here is a mockup of the code I used to get the dataset:
>
> ----
>
> Dim daTemp As OleDbDataAdapter
> Dim dsResult As New DataSet
> ' mconMainDB is the connection to the database that is already open at
this
> point
>
> ' Build query
> strSQL = "SELECT [FirstName],[LastName],[FirstName] & ' ' & [LastName] AS
> [FullName] FROM [tblPeople];"
>
> ' Create data adapter
> daTemp = New OleDbDataAdapter(strSQL, mconMainDB)
>
> ' Make sure data adapter gets primary key info when it fills the dataset
> daTemp.MissingSchemaAction = MissingSchemaAction.AddWithKey
>
> ' Get dataset of appointments
> daTemp.Fill(dsResult, strDataTableName)
>
> ' Clean up
> daTemp.Dispose()
>
> ----
>
> I'll be able to edit the [FirstName] and [LastName] columns, but not the
> [FullName] column.
>
>
> - Don
>
>
>
>
> "Nicole Calinoiu" <nicolec@somewhere.net> wrote in message
> news:##3XSTanDHA.2404@TK2MSFTNGP12.phx.gbl...
> > Don,
> >
> > If this is a typed dataset, the element for the column would have been
> > automatically marked as read-only if you created the dataset table by
> > dragging a saved query/view onto the dataset design surface. To fix
this,
> > open the XSD file, select the FullName element in dataset view, and set
> its
> > ReadOnly property to false.
> >
> > If this is not a typed dataset, you should not be seeing this problem.
If
> > so, how are you creating and filling the dataset?
> >
> > HTH,
> > Nicole
> >
> >
> > "Don" <unknown@oblivion.com> wrote in message
> > news:VRBnb.208347$pl3.160042@pd7tw3no...
> > > I've created a dataset from a query that returns a column from an
> > > amalgamation of fields in the database.
> > >
> > > e.g. SELECT [FirstName] & ' ' & [LastName] AS [FullName] FROM
> [tblPeople]
> > >
> > > However, when I try to modify the value of this column ([FullName], in
> the
> > > example), I get an error saying it's read only. I can edit the other
> > > columns just fine, but I cannot modify this one.
> > >
> > > Is there any way to make the dataset allow me to modify data in this
> > column?
> > > The dataset just contains throwaway data that I'm never going to write
> > back
> > > to the database anyway.
> > >
> > > - Don
> > >
> > >
> >
> >
>
>