G
Gr8North
I'm relatively new to .Net, and would appreciate a little assistance.
I have multiple datasets attached to individual grids on individual tabs on
a form.
I would like to have a series of generic functions such as SaveChange,
RejectChanges, passing a grid and related dataset. As the datasets are
different types, I'm passing them as an object. I dont wish to override the
function with multiple copies and duplicated code.
However, Option Strict On, disallows late binding.
I've tried ds.gettype and passing the ds type, but cant figure it out.
Pseudo code
if tabName = "A" then
SaveChanges( gridA, dsA)
elseif tabName = "B" then
SaveChanges( gridB, dsB)
' many more
end if
Sub SaveChanges( ByVal grid as Infragistics.Win.UltraWinGrid.UltraGrid,
ByVal ds As Object )
' Code removed
if ds.haschanges then
ds.update
end if
end sub
I have multiple datasets attached to individual grids on individual tabs on
a form.
I would like to have a series of generic functions such as SaveChange,
RejectChanges, passing a grid and related dataset. As the datasets are
different types, I'm passing them as an object. I dont wish to override the
function with multiple copies and duplicated code.
However, Option Strict On, disallows late binding.
I've tried ds.gettype and passing the ds type, but cant figure it out.
Pseudo code
if tabName = "A" then
SaveChanges( gridA, dsA)
elseif tabName = "B" then
SaveChanges( gridB, dsB)
' many more
end if
Sub SaveChanges( ByVal grid as Infragistics.Win.UltraWinGrid.UltraGrid,
ByVal ds As Object )
' Code removed
if ds.haschanges then
ds.update
end if
end sub