Turkish Characters Problem While Updating Database...
hi everybody.. have problem updating datas...
there no problem while inserting data database...but when update them, there have been problems turkish characters.
for example "ş,ğ,ı," change "s,g,i"...
how can sovle this?
and codes below...
namespace haberleryonetim { public partial class haber_duzenle : system.web.ui.page { protected void page_load(object sender, eventargs e) { if (session["kullaniciadi"] == null) { response.redirect("default.aspx"); } else if (!page.ispostback) { sqlconnection cnn = new sqlconnection(configurationmanager.connectionstrings["haberleryonetim"].connectionstring); cnn.open(); sqlcommand cmd = new sqlcommand("select id,haberbaslik,haberozet,habermetin haberleryonetimtable id=@id", cnn); cmd.parameters.addwithvalue("@id", request.querystring["id"]); sqldatareader dr = cmd.executereader(); while (dr.read()) { txthaberbaslikgetir.text = dr["haberbaslik"].tostring(); txthaberozetgetir.text = dr["haberozet"].tostring(); txthabermetingetir.text = dr["habermetin"].tostring(); } dr.close(); cnn.close(); } } protected void btnhaberguncelle_click(object sender, eventargs e) { sqlconnection cnn = new sqlconnection(configurationmanager.connectionstrings["haberleryonetim"].connectionstring); cnn.open(); sqlcommand cmd = new sqlcommand("update haberleryonetimtable set haberbaslik='" + txthaberbaslikgetir.text + "',haberozet='" + txthaberozetgetir.text + "',habermetin='" + txthabermetingetir.text + "' id=@id", cnn); cmd.parameters.addwithvalue("@id", request.querystring["id"]); sqldataadapter da = new sqldataadapter(cmd); dataset ds = new dataset(); da.fill(ds); cnn.close(); response.redirect("haberler.aspx"); } protected void btnhabersil_click(object sender, eventargs e) { sqlconnection cnn = new sqlconnection(configurationmanager.connectionstrings["haberleryonetim"].connectionstring); sqlcommand cmd = new sqlcommand("delete haberleryonetimtable id=@id", cnn); cmd.parameters.addwithvalue("@id", request.querystring["id"]); cnn.open(); cmd.executenonquery(); cnn.close(); response.redirect("haberler.aspx"); } } }
faisal ahmed farooqui —————————— if post answers question, please click "mark answer" on post , "mark helpful".
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment