VB.net SQL data reader needs tweaking -
i have issue whereby 'using' sql query returning result where, if access db directly doesn't
here's code datareader
using cmdobj new sqlclient.sqlcommand("select name dbo.cases case_reference = 'ab-" & textbox_case_ref.text & "-" & combobox_ref_year.selecteditem & "'", sqlconn) using readerobj sqlclient.sqldatareader = cmdobj.executereader while readerobj.read lima_op_name = readerobj("name").tostring end while end using end using
things have ony got complicated since changed our case reference 'ab-#####-yy' #######
the problem that, long case reference exists, resulting 'name' returned correctly, case reference doesn't exist, seems return name of highest numbered case anyway!
if run same query in sql management, returns empty cell...
i alreasdy have 'if name = "", error' type line, isn't working query 'is' returning name - shouldn't doing. need better error correction in there?
additionally, can assist, want pad out entry in 'textbox_case_ref' 5 digits '0's user can type 1, 2, 3, , turn 00001, 00002, 00003?
thanks
richard
Comments
Post a Comment