c# - Insert data from forms into datasets -


i have dataset set 3 fields, id username , password. want user type in new username , passoword , gets saved dataset. how take has been typed in , save data set?

so far code have

userstableadapters.userstableadapter user = new userstableadapters.userstableadapter(); user.usersdatatable usertable = user.getdata(); 

this allows me connect data set although not sure how take values user enter in input boxes , save them dataset?

a quick , dirty implementation of this:

dataset ds = new dataset(); ds.tables.add(textbox1.text);  //i did in winforms so, result may vary. ds.tables.add(textbox2.text);  //same here.  if (ds.haschanges())  //check if dataset has changes.    ds.acceptchanges(); //if does, commit them. 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -