Just check whether u have declared and initialized all con,da,ds,dv objects
and also check whether u have filled dv with any of the tables in ds.
Ur code can be as follows:
Dim con as OledbConnection
Dim da as OledbDataAdapter
Dim ds as DataSet
Dim dv as DataView
private sub setcon()
con=new OledbConnection("Provider=...;Data Source=...")
da=new OledbDataAdapter("Select * from tblname",con)
ds= new DataSet()
da.fill(ds,"alias_table_name")
dv=new DataView(ds.Tables("alias_table_name"))
gv.DataSource=dv
gv.refresh
end sub
u can call this procedure at the form load event
On 09/06/2009, BlueVista <[email protected]> wrote:
>
>
> I am getting Null Object error (gv.datasource=dv at this line)????
> anyone????