Hi

I have a strongly typed dataset generated by vs 2008. I am trying to fill in
one of the datatables in the dataset and then cerate a dataview from the
datatable. I have used the below code but it does not work.

Public ds As MyDS
Public dv As DataView
Public daMyTbl As MyDSTableAdapters.MyTblTableAdapter

ds.MyTbl.Clear()
daMyTbl.Fill(ds.MyTbl)

dv = New DataView(ds.MyTbl)

For starters it givbes 'Object reference not set to an instance of an
object.' error on ds.MyTbl.Clear() line. What am I doing wrong?

Many Thanks

Regards

Re: Generating a dataview from a datatable by Steve

Steve
Sun Mar 09 20:18:38 CDT 2008

John wrote:
> Hi
>
> I have a strongly typed dataset generated by vs 2008. I am trying to
> fill in one of the datatables in the dataset and then cerate a
> dataview from the datatable. I have used the below code but it does
> not work.
> Public ds As MyDS
> Public dv As DataView
> Public daMyTbl As MyDSTableAdapters.MyTblTableAdapter
>
> ds.MyTbl.Clear()
> daMyTbl.Fill(ds.MyTbl)
>
> dv = New DataView(ds.MyTbl)
>
> For starters it givbes 'Object reference not set to an instance of an
> object.' error on ds.MyTbl.Clear() line. What am I doing wrong?
>
> Many Thanks
>
> Regards

As with any object, you need
ds = New MyDS

You'll probably want one for daMyTbl as well.



Re: Generating a dataview from a datatable by Cor

Cor
Sun Mar 09 23:55:40 CDT 2008


> You'll probably want one for daMyTbl as well.
>

No that is in the new strongly typed dataset

Cor