Click here to Skip to main content
15,877,145 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all.....
I have created one application In JQgrid which working good....

Bur while testing i enter one record With inserting State name as

'UP&' its get inserted properly.....

But its not displaying in grid....


While Select query its throwing an exception of type
'System.InvalidOperationException'.....

My code for select query is

DataReader sdrState = db.getDR("udsp_SelectState", prmPage, prmLimit, prmSidx, prmSord);
XML
if (sdrState.HasRows)
                   {
                       int i = 1,j=0;
                       xml += "<?xml version='1.0' encoding='utf-8'?><rows>";
                       while (sdrState.Read())
                       {
                           if (i == 1)
                           {
                               if (page == 0)
                               {
                                   page = 1;
                               }
                               xml += "<page>" + page + "</page>";// +"<records>" + sdrState["totalRecords"] + "</records>";
                               i++;
                           }
                           //context.Response.Write(ds.Tables[0].Rows[j]["StateName"].ToString()+"<br>");
                           xml += "<row id='" + sdrState["StateId"] + "'>";
                           xml += "<cell>" + sdrState["StateName"] + "</cell>";
                           xml += "<cell>" + sdrState["CountryName"] + "</cell>";
                           xml += "</row>";
                           j++;
                       }
                       xml += "</rows>";
                   }


Its throwing an exception in while fetching statename coz state name is like 'UP&'

i dont knw wat is wrong

I will appreciate any help......
Posted
Updated 1-May-11 20:55pm
v2
Comments
Sergey Alexandrovich Kryukov 2-May-11 2:21am    
This is not an error report. Catch all exceptions in this thread, make full exception dump with stack and show the relevant part of code; point out line where exception goes...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900