c# - value cannot be null in wcf using xml -
i'm triyng converto string xml when code running "value cannot null" how cani fix ? project run in windows phone 8
public string baslıkbul(baslıkı ba) { sqlconnection bag = new sqlconnection(configurationmanager.connectionstrings["baglantı"].connectionstring.tostring()); bag.open(); sqlcommand yap = new sqlcommand("select baslık ad=@ad",bag); yap.parameters.addwithvalue("@ad", ba.ad); yap.executenonquery(); sqldataadapter da = new sqldataadapter(yap); dataset ds = new dataset(); da.fill(ds); string s = ds.getxml(); /// line running xmlreader okuyucu = xmlreader.create(new stringreader(s)); while(okuyucu.read()) { if(okuyucu.nodetype==xmlnodetype.element) { switch(okuyucu.name) { case"baslık": s = convert.tostring(okuyucu.readstring()); s = ba.baslık; break; } } } bag.close(); return ba.baslık;
most likely, value supply ad
parameter (ie. ba.ad
) null
. in case value want use in clause filtering, should pass system.dbnull instead.
Comments
Post a Comment