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

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -