Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I fetch the XML data in Textbox from Database.Now i want to make some changes and update in DB.when i try to make changes textbox not allowed text,but it remmove the data. MY code
private void button1_Click(object sender, EventArgs e)
   {
       connection.Open();
       string str = "select col1 from Table where Clo2='" + txt1.Text + "'";
       SqlCommand command = new SqlCommand(str, con);
       XmlReader xmlreader = command .ExecuteXmlReader();
       xmlreader.Read();
       txt2.Text = xml.ReadOuterXml();
       XmlDocument document = new XmlDocument();
       document .PreserveWhitespace = true;
       document .LoadXml(txt2.Text);

   }

how can i enter text in Textbox
Posted
Comments
Sergey Alexandrovich Kryukov 11-May-15 2:58am    
The question makes no sense. You already "enter text in TextBox"...
—SA
Member 10237574 11-May-15 3:02am    
ok..now i want to change some data in that textbox here textbox not allowed to make changes

Sergey Alexandrovich Kryukov 11-May-15 3:07am    
How come it's not allowed? You already "change some data"...
—SA
Member 10237574 11-May-15 3:10am    
sir.in button click i get the xml data in textbox and make some changes and hit another button.in second button click the updated data will be saved in DB.so,i get the data in textbox and it is not allowed to write...
Sergey Alexandrovich Kryukov 11-May-15 3:14am    
And?..
—SA

1 solution

* Are you certain you didnt place another textbox above this one?
* Is the textbox attribute ReadOnly=false?
* Is the textbox attribute Enabled=true?
 
Share this answer
 

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