我控制器顯示errror PLS解決示值誤差不能將列表轉換爲字符串無法隱式轉換類型「字符串」到「System.Collections.Generic.List <string>
public JsonResult GetProperty_id(int selectedValue)
{
List <string> properties = new List <string>().ToList();
// Property model1 = new Property();
SqlConnection con = new SqlConnection("Server=miracle\\SQLExpress; database=CRUIdb; user id=sa; password=dotnet");
con.Open();
SqlCommand cmd = new SqlCommand("SELECT property_id FROM Service_Property WHERE service_id =" + selectedValue, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
properties = (ds.Tables[0].Rows[0]["property_id"]); //error cannot covert
}
return Json(properties, JsonRequestBehavior.AllowGet);
}
@Jenish Rabadiya你可以看看這個問題嗎? http://stackoverflow.com/questions/43122189/onesignal-push-notification-clickevent-show-empty-values-windows-phone-8-1-c-sha – Arsal 2017-04-04 22:51:39
@Arsal這不是我發起這個線程。我剛剛編輯了這個問題,以使其更具可讀性。 – 2017-04-05 03:35:09