mysql - Why is it that my datagrid is working to input data into the db, but my textboxes are not? -
here code:
imports system.data imports system.data.sqlclient public class form2 private conn new sqlconnection("data source=wal1sql1;initial catalog=valuetracker;integrated security=true") private da new sqldataadapter("select * valuesources", conn) private ds new dataset private cmb new sqlcommandbuilder(da) 'declaration public property allowdbnull boolean private sub addnullallowedcolumn() dim column datacolumn column = new datacolumn("valuesourceid", _ system.type.gettype("system.int32")) column.allowdbnull = true ' add column new datatable. dim table datatable table = new datatable table.columns.add(column) end sub private sub valuesourcesbindingnavigatorsaveitem_click(sender object, e eventargs) handles valuesourcesbindingnavigatorsaveitem.click da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) end sub private sub form2_load(sender object, e eventargs) handles mybase.load try da.fill(ds, "valuesources") valuesourcesdatagridview.datasource = ds.tables("valuesources") catch end try 'todo: line of code loads data 'valuetrackerdataset.valuesourceavailability' table. can move, or remove it, needed. me.valuesourceavailabilitytableadapter.fill(me.valuetrackerdataset.valuesourceavailability) 'todo: line of code loads data 'valuetrackerdataset.valuesources' table. can move, or remove it, needed. me.valuesourcestableadapter.fill(me.valuetrackerdataset.valuesources) 'me.valuesourcestableadapter.getdata() end sub private sub servicetypeidtextbox_textchanged(sender object, e eventargs) end sub private sub bindingnavigatoraddnewitem_click(sender object, e eventargs) handles bindingnavigatoraddnewitem.click end sub private sub valuesourcesbindingnavigator_refreshitems(sender object, e eventargs) handles valuesourcesbindingnavigator.refreshitems end sub private sub savebutton_click(sender object, e eventargs) handles savebutton.click da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) msgbox("successfully saved") end sub private sub valuesourceidtextbox_textchanged(sender object, e eventargs) end sub private sub valuesourcenametextbox_textchanged(sender object, e eventargs) da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) end sub private sub valuesourcedescriptiontextbox_textchanged(sender object, e eventargs) da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) end sub private sub servicetypeidtextbox_textchanged_1(sender object, e eventargs) da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) end sub private sub usecaseidtextbox_textchanged(sender object, e eventargs) da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) end sub private sub createdatedatetimepicker_valuechanged(sender object, e eventargs) da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) end sub private sub createbytextbox_textchanged(sender object, e eventargs) da.updatecommand = cmb.getupdatecommand da.update(ds.tables("valuesources")) end sub private sub valuesourcedescriptiontextbox_textchanged_1(sender object, e eventargs) handles valuesourcedescriptiontextbox.textchanged end sub private sub valuesourcedescriptionlabel_click(sender object, e eventargs) end sub private sub button1_click(sender object, e eventargs) handles button1.click me.hide() mainmenu.show() end sub end class
my question is:
why datagrid working input data db, textboxes not?
there disconnect somewhere , can't figure out.
usually ..
da.updatecommand = cmb.getupdatecommand da.executenonquery
Comments
Post a Comment