vb.net - How to change value of /GrpPwd/ Cell in all Rows? -
i need perform sql query:
update resurses set grppwd = @grppwd1 resurs = @resurs1
for rows in access database using vb.net how can it?
i use code id doesn't work:
password generator:
dim charset string = nalf dim r new random() dim lenpass integer = r.next(minlength, maxlength) dim str string = string.empty integer = 0 lenpass - 1 str += charset(r.next(0, charset.length)) next return str end function
update rows
if datagridview1.currentrow.cells(3).value = "yes" nres = datagridview1.currentrow.cells(0).value nalf = datagridview1.currentrow.cells(6).value nsym = datagridview1.currentrow.cells(1).value dim parol1 string dim pwd string = pass99(nsym, nsym) ' parol1 = pwd dim cmd new oledbcommand() dim conn new oledb.oledbconnection("provider=microsoft.ace.oledb.12.0; data source=" + bpath) cmd.connection = conn conn.open() integer = 0 k - 1 cmd.commandtext = string.format("update resurses set grppwd = @grppwd1{0} resurs = @resurs1{0};", i) cmd.parameters.add(string.format("@grppwd1{0}", i), oledbtype.wchar).value = parol1 cmd.parameters.add(string.format("@resurs1{0}", i), oledbtype.integer).value = nres next cmd.executenonquery() conn.close() msgbox("all rows updated!") end if
f
Comments
Post a Comment