vb.net - If Else using Column in Table -



vb.net - If Else using Column in Table -

i have table named studentlogs.. , has column status on it.. when finished inserting records on pupil logs .. want utilize if else statement.. status column can have 3 values either 1,2 , 3..

now.. wanted after insert records.. doing..

if status="1" phone call sendsms() endif` if status="2" msgbox("")endif if status="3" msgbox("")

how can when dealing columns? thanks..:)

try using case statement when there more 1 potential value prevent having utilize lot of elseif statements. value of row in specifical column, utilize parenthesis right after row object , specify columnname or columnindex property value.

class="lang-vb prettyprint-override"> 'declare local variables dim dr datarow 'create table dim studentlogs new datatable("studentlogs") 'add columns studentlogs .columns.add("status", gettype(integer)) .columns.add("othercol1", gettype(string)) end 'add values studentlogs dr = studentlogs.newrow() dr("status") = 1 dr("othercol1") = "joey" studentlogs.rows.add(dr) end each row datarow in studentlogs.rows select case row("status") case 1 phone call sendsms() case 2 msgbox("2") exit case 3 msgbox("3") end select next

vb.net

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -