The multi-part identifier “TextBox1.Text” could not be bound in C# ASP.NET?

前端 未结 3 1629
孤独总比滥情好
孤独总比滥情好 2020-12-12 04:03

I\'m doing a practice project for training; my handler has specifically forbidden paramaterization and security-oriented coding for now, in the interest of getting the basic

3条回答
  •  心在旅途
    2020-12-12 04:23

    You have to pass the value of the Text property of the TextBox controls to the query not the "TextBox.Text" as a string:

    string updateQuery = "UPDATE ProductInstance SET CustId = " + TextBox1.Text + ", CustName = '" + TextBox2.Text + "', .... " + x;
    

    NOTE:

    If the value of the "Text" property was a string the you have to place a ' on the two sides of the value like in the example above.

提交回复
热议问题