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

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -