asp.net - Get the values from dataset in vb.net -


i first time coding vb.net , wanted read values dataset.

for have coded follows, not working:

 protected sub page_load(byval sender object, byval e system.eventargs) handles me.load         '------------------------------load name------------------'          try             dim strcon string = configurationmanager.connectionstrings("connstringdb").connectionstring             dim integer             dim con new sqlconnection(strcon)              da = new sqldataadapter("select empname empmaster_vb", con)             ds = new dataset()             da.fill(ds)             for(i=0;i<ds.            catch ex exception          end try   end sub 

as take values dataset in c# tried vb (from loop) as,

for(int i=0;i<ds.tables[0].rows.count;i++) {    int somevar=int.parse(ds.tables[0].rows[i][0].tostring());  } 

but not working in vb.net coded above,,

please me.

you can try this:

for integer = 0 ds.tables(0).rows.count - 1     dim somevar integer = integer.parse(ds.tables(0).rows(i)(0).tostring()) next 

you can use online converter resolve issue.


Comments