vb.net - getting data from datagridview and adding itto another table -



vb.net - getting data from datagridview and adding itto another table -

im doing software handle library, book stock, readers getting books , whatnot... in form im suppose register book loan, maintain getting error saying system.invalidcastexception unhandled hresult=-2147467262 message=o operador '&' não está definido para cadeia "insert levantamento values(" e tipo 'datarowview'.(the operator & not defined string..... , says type info row view

this code gets info datagrid view textbox

dim s string = datagridview1.rows(datagridview1.currentrow.index).cells(0).value 'command bring info itemid matches selected cell row itemid dim cmd new sqlcommand("select livro.id_livro, livro.titulo, autor.autor, [tipo de livro].tipodelivro, livro.[data de ediçao], livro.quantidade livro inner bring together autor on livro.id_autor = autor.id_autor inner bring together [tipo de livro] on livro.id_tipodelivro = [tipo de livro].id_tipodelivro livro.id_livro =" + s + "", con) dim ds new dataset() dim da new sqldataadapter(cmd) ds.clear() da.fill(ds) textbox1.text = ds.tables(0).rows(0)("titulo").tostring() textbox2.text = ds.tables(0).rows(0)("quantidade").tostring()

and code utilize insert info intented database, first inserts fields(2 of them dates varchar in database, thing is... of fields of intended table ids... visually see text... mayb thats it?

dim sql string = "insert levantamento values('" & textbox1.text & "','" & combobox1.selectedvalue & "','" & textbox4.text & "','" & textbox5.text & "')" dim sqlcom new sqlcommand(sql, con) dim dr sqldatareader = sqlcom.executereader() dim temp2 double = textbox2.text dim temp3 double = temp2 - temp3 textbox3.text += temp3 dim sqlstr4 string = "update livro set quantidade='" & textbox3.text & "' titulo = '" & textbox1.text & "'" comando = new sqlclient.sqlcommand(sqlstr4, con) comando.executenonquery()

my guess issue combobox1.selectedvalue. have bound datatable combobox not set valuemember?

vb.net

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -