android - passing null value as a parameter in java -


i have method insert datas sq-lite db

 public long insertdetails(int id,string batchname,double weight,         double yield) {     contentvalues insertcontentvalues = assesmentinsertvalues(id,batchname,weight,yield);     return this.data.insert("tb_labassessment", null, insertcontentvalues); } 

from main class m passing values parameter above function, in cases want pass weight , yield null values.

string batchname; double weight; double yield; dbadapter.insertassesmentdetails(objclsproduct.getid(),batchname,weight,yield) 

how can pass values of weight , yield null here.

you can't pass primitive null. there's 2 ways this- first make function take double- class version of double. other pass in unused value, such -1, mean null. requires there reasonable default value though.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -