c# - WCF ado.net Insert record (at end) -


stackers,

i have been troubled problem long, decided post question here.

this whats bothering me. writing app windowsphone 8. app revolves around local , remote database. local database part easy part. now, want use wcf service insert records remote db (using ado.net service @ serverside). have succesfully inserted records in remote database there's catch (atleast im aiming at).

my database table (in im inserting) has primary key , don't want tell/insert primary key when insert data database. want insert new record after last record. there way this?

this have far:

private measuremententities context; context = new measuremententities(new uri("http://192.168.11.240:85/nfcdataservice.svc/"));  public void saveanwserstodblocal(bool ans1, bool ans2, bool ans3)         {             measurement temp = new measurement();              temp.anwser1 = ans1;             temp.anwser2 = ans2;             temp.anwser3 = ans3;             temp.measurementid = 1; // primary key, , want rid of this.             // want insert @ end of database. how?              // add local collection.             _measurementcollection.add(temp);              context.addtomeasurements(temp);              context.beginsavechanges(savechangescallback, temp);              //if wifi on:             uploadmeasurements();         } 

okay, stupid. in mssql table, had not enabled feature add rows auto increment. atleast, had enabled increment set 0. point same record.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -