【发布时间】:2010-06-20 00:37:38
【问题描述】:
我还有另一个class that creates the connection(请参阅页面下半部分的精致课程),我相信它可以连接,或者至少我在运行时没有遇到任何异常。
我现在想将数据插入到我的数据库中,但没有任何更新。 我正在尝试关注this 示例,但它是为了阅读。
我确实在显示 SQL 窗格上运行了“querystring”,它确实执行正确。它将数据作为新行正确插入。
不知道在我的最后一行之后该做什么?谢谢。
string queryString =
"INSERT INTO UserData UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES ('a051fc1b-4f51-485b-a07d-0f378528974e', 2, 2, 2);";
protected void Button1_Click(object sender, EventArgs e)
{
MySqlConnection database = new MySqlConnection();
database.CreateConn();
Command = new SqlCommand(queryString, database.Connection); //
}
【问题讨论】:
标签: asp.net html windows database