我想从 android 接收数据到我的网络服务,我的网络服务将把数据插入我的数据库。我将如何将数据从我的 Web 服务插入数据库。
这是我的代码开始:
[WebMethod]
public StudentTransactions GetStudentTransactions(string Name, string CLass, string NRIC, int StallNo, float AmountSpent)
{
SqlCommand sql1 = new SqlCommand("INSERT Into StudentTransactions (Name, CLass,NRIC,StallNo,AmountSpent) VALUES (Name,CLass,NRIC,StallNo,AmountSpent)");
using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ncpsdbbConnectionString2"].ConnectionString))
{
conn.Open();
{
}
}