/// <summary>
/// 查询,关联表,返回字符串,然后在后台分隔
/// </summary>
/// <param name="dishid"></param>
/// <param name="ShopID"></param>
/// <param name="AppID"></param>
/// <returns></returns>
public static string[] getDish_DishTagID(int dishid, int ShopID, int AppID)
{
string sql = "SELECT TagID FROM Dish_DishTags WHERE DishID=@DishID and ShopID=@ShopID and AppID=@AppID";
DbCommand cmd = Db_CanYin.GetSqlStringCommand(Convert.ToString(Sql));
Db_CanYin.AddInParameter(cmd, "@AppID", DbType.Int32, AppID);
Db_CanYin.AddInParameter(cmd, "@ShopID", DbType.Int32, ShopID);
Db_CanYin.AddInParameter(cmd, "@DishID", DbType.Int32, dishid);
return new string[] { "", "" };
//return Convert.ToString(Db_CanYin.ExecuteScalar(cmd));
}
/// 查询,关联表,返回字符串,然后在后台分隔
/// </summary>
/// <param name="dishid"></param>
/// <param name="ShopID"></param>
/// <param name="AppID"></param>
/// <returns></returns>
public static string[] getDish_DishTagID(int dishid, int ShopID, int AppID)
{
string sql = "SELECT TagID FROM Dish_DishTags WHERE DishID=@DishID and ShopID=@ShopID and AppID=@AppID";
DbCommand cmd = Db_CanYin.GetSqlStringCommand(Convert.ToString(Sql));
Db_CanYin.AddInParameter(cmd, "@AppID", DbType.Int32, AppID);
Db_CanYin.AddInParameter(cmd, "@ShopID", DbType.Int32, ShopID);
Db_CanYin.AddInParameter(cmd, "@DishID", DbType.Int32, dishid);
return new string[] { "", "" };
//return Convert.ToString(Db_CanYin.ExecuteScalar(cmd));
}

该代码段展示了一个静态方法,用于查询Dish_DishTags表中与指定DishID、ShopID和AppID匹配的TagID,并以字符串数组形式返回结果。虽然SQL查询语句已准备,但实际返回的是一个空字符串数组。
652

被折叠的 条评论
为什么被折叠?



