vb.net - Late binding in query -
yes know option strict , use quite often. issue stemming linq query , can't seem figure out how throwing up. wanting datarows in given table row's id equals id give it. query works fine without option strict on rows need, want have on.
the error: option strict on disallow's late binding
here's have right now...
dim crows() datarow = (from crow in masterdataset.tables(1).rows crow(childtablekey) = intparid).toarray the error happening underneath: crow(childtablekey)
i know error mean's well, can't seem figure how stop seeing error. have tried casting , such well...
try using
in masterdataset.tables(1) ctype(crow(childtablekey), integer) instead of
in masterdataset.tables(1).rows crow(childtablekey) the example below working me option strict:
dim ds new dataset dim dt new datatable ds.tables.add(dt) dim dc new datacolumn dc.datatype = gettype(system.int32) dt.columns.add(dc) dim dr datarow = dt.newrow dr(0) = 10 dt.rows.add(dr) dim rows datarow() = (from r in ds.tables(0) ctype(r(0), integer) = 10).toarray
Comments
Post a Comment