Re: DataGrid - clever way to update DataSet

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



How does this help the OP? The question wasn't how to dynamically generate
tables, it was how to dynamically update a dataset from changes in a grid
when the dataset has been created dynamically.

In addition, a CommandBuilder is also available for other data sources
besides SQL, however it is generally considered NOT a good idea to use it as
it is limited in situations where it will create correct statements.


"Val Mazur (MVP)" <group51a@xxxxxxxxxxx> wrote in message
news:OspeDGVcFHA.132@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> If you are using SQL Server, then you could use CommandBuilder class that
> will allow you automatically build INSERT, UPDATE and DELETE SQL
> statements for your DataAdapter based on your SELECT statement. I believe
> it should work for you
>
> --
> Val Mazur
> Microsoft MVP
>
> http://xport.mvps.org
>
>
>
> "st" <st@xxxxxxxxx> wrote in message
> news:1118800256.333813.54220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> Hi Scott,
>>
>> Thanks for the information.
>>
>> As the source table for the DataGrid can change, I need a solution that
>> doesn't hard-code field names into the update.
>>
>> Has anybody created a routine that will cope with this situation?
>>
>> Thanks,
>>
>> Simon
>>
>
>


.



Relevant Pages

  • Re: Please display the table faster in the datagrid
    ... I doubt I have the sql command correct but I think you will see what I'm talking about. ... Additional complication added if user has ability to sort grid by different columns. ... you should know total number of records and somehow "cheat" the scrollbar of your control. ... One of modifications of this solution can be the following: you populate data on demand but all populated data remains in place even if it is currently invisible - this way you don't need to retrieve data once populated. ...
    (microsoft.public.vb.database)
  • bug? cannot get value of cell on invisible column
    ... This works nicely and one does not see the id field when the grid is displayed nor is it editable. ... Then I made the column visible but the field readonly and that caused the sql "update" command to fail as the update command skipped over that "id" field and put "authString" where id was supposed to go causing an exception on the sqlserver. ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: How to requery grid based on query
    ... you will get the REQUERY() orportunity if you use a view instead of a query. ... CREATE SQL VIEW Command ... Form runs, grid> displays data. ... a grid does not have a requery> method. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Select - SQL vs. SUM
    ... SQL SELECT doesn't read the buffered data in the Grid, ... > I have a grid whose recordsource is a table named _payments. ... > first time and hit Enter key, the value in txtUnused is updated and the ...
    (microsoft.public.fox.programmer.exchange)
  • Re: VB ADO.NET Concurrency, Access, date fields and parameters
    ... Hi Bill, thank you very much for your help, it is much apreciated. ... >> I then edit a date in the grid. ... > Not sure what your update command looks like but that's the likely source. ... > There's no profiler that I konw of for Access, but if you ever use SQL ...
    (microsoft.public.dotnet.framework.adonet)