gpt4 book ai didi

c# - DB 中的 System.Web.UI.WebControls.TextBox

转载 作者:行者123 更新时间:2023-12-03 22:01:07 25 4
gpt4 key购买 nike

SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)");
string qry = "INSERT INTO temporary_markers (location) VALUES ('" + txtlocation + "')";
SqlCommand cmd = new SqlCommand(qry, con);

上面的代码片段是我用来将值传递给数据库的。该值被传递但“System.Web.UI.WebControls.TextBox”是表中的内容

最佳答案

使用 txtlocation.Text而不是 txtlocation .

txtlocation.Text is the string you want.

txtlocation is your TextBox

关于c# - DB 中的 System.Web.UI.WebControls.TextBox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59476149/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com