评级系统网上商店 [英] Rating system webshop
本文介绍了评级系统网上商店的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在我的网店上建立一个评级系统。
我创建一个文本框,用户可以在其中指定他们给出产品的评级。
当用户点击费率按钮时,必须在数据库中添加一个新列,
包括artikel_nr和评级。
当用户点击它时,我只是不知道如何向数据库添加列。
这是我的代码隐藏:
Hi, I'm trying to make a rating system on my webshop.
Im creating a textbox in which the user can specify the rating they give a product.
When the user clicks the "rate" button, a new column must be added to the database which
includes the "artikel_nr" and the "rating".
I just dont know how to add a column to the database when the user clicks on it.
This is my codebehind:
protected void rate_Click(object sender, EventArgs e)
{
string rating = rate.Text;
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|bier.mdb";
OleDbConnection connection = new OleDbConnection(connectionString);
OleDbCommand cmdins = new OleDbCommand("INSERT INTO Rating (artikel_nr, Rating) VALUES (@artikel, @Rating) WHERE artikel_nr = @artikel_nr", connection);
cmdins.Connection.Open();
cmdins.Parameters.AddWithValue("@artikel", @artikel_nr);
cmdins.Parameters.AddWithValue("@Rating", rating);
cmdins.Parameters.Clear();
cmdins.Connection.Close();
}
Thnx
Thnx
推荐答案
参考这些链接了解如何实施评级控制。
AJAX评级控制示例 [ ^ ]
C#星级控制 [ ^ ]
问候..:)
Refer to these links to see how to implement rating control.
AJAX Rating Control Example[^]
C# Star Rating Control[^]
Regards.. :)
这篇关于评级系统网上商店的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文