我有一个项目(c#)并有以下代码。一切正常。但我只想知道如何测试它并在 Visual Studio 2010 中查看结果。我是经典的 asp 开发人员,总是Response.end()
用来获取结果。但不知道如何在 c# 项目中做到这一点。谢谢。
public static string ApplicationLocationList()
{
GetApplicationLocationListTableAdapter getApplicationLocationListTableAdapter = new GetApplicationLocationListTableAdapter();
DataTable dtgetApplicationLocationListTableAdapter.GetApplicationLocationListData(Library.MovieClass.saveApplicationID);
if (dt.Rows.Count > 0)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dt.Rows.Count; i++)
{
string cityList = dt.Rows[i]["City"].ToString();
string stateList = dt.Rows[i]["State"].ToString();
sb.Append(cityList + "," + stateList + System.Environment.NewLine);
}
return sb.ToString();
}
else
{
return string.Empty;
}
}