0

ステップ1(作業)

//asp.net

public DataSet RepairList()
    {
        DataSet ds = new DataSet();
        try
        {
            openConnection();
            komut.CommandText = "RepairList";
            da.Fill(ds);
        }
        catch (Exception ex)
        {
            LogClass MyLog = new LogClass();
            MyLog.LogInsert("", "221", ex.ToString(), "0");
        }
        finally
        {
            closeConnection();
        }

        return ds;
    }

// sql

CREATE PROCEDURE [dbo].[RepairList]
AS
BEGIN
    SET NOCOUNT ON;
    Select Id, ProductId from Repairs Order By Id Desc
END

// result  
 1   3,
 2   4,
 4   9

ステップ2(機能しない)手順を変更します。SQLでは機能しますが、asp.netでは異なる結果が得られます。

//asp.net

public DataSet RepairList()
    {
        DataSet ds = new DataSet();
        try
        {
            openConnection();
            komut.CommandText = "RepairList";
            da.Fill(ds);
        }
        catch (Exception ex)
        {
            LogClass MyLog = new LogClass();
            MyLog.LogInsert("", "221", ex.ToString(), "0");
        }
        finally
        {
            closeConnection();
        }

        return ds;
    }

// sql

ALTER PROCEDURE [dbo].[RepairList]
AS
BEGIN
    SET NOCOUNT ON;
    Select Id, ProductId, ImageUrl from Repairs Order By Id Desc
END

//sql result 

         1   3   asdf.jpg,
         2   4   df.jpg,
         4   9   sfkas.jpg


//asp.net result(wrong)  

         1   3,
         2   4,
         4   9

ステップ3(作業)同じプロシージャを作成しますが、名前が異なります(RepairList-> RepairsList)。結果は同じで正しいです

//asp.net

public DataSet RepairList()
    {
        DataSet ds = new DataSet();
        try
        {
            openConnection();
            komut.CommandText = "RepairsList";
            da.Fill(ds);
        }
        catch (Exception ex)
        {
            LogClass MyLog = new LogClass();
            MyLog.LogInsert("", "221", ex.ToString(), "0");
        }
        finally
        {
            closeConnection();
        }

        return ds;
    }


//sql


CREATE PROCEDURE [dbo].[RepairsList]
AS
BEGIN
    SET NOCOUNT ON;
    Select Id, ProductId, ImageUrl from Repairs Order By Id Desc
END
//sql result 
         1   3   asdf.jpg,
         2   4   df.jpg,
         4   9   sfkas.jpg

//asp.net result 
         1   3   asdf.jpg,
         2   4   df.jpg,
         4   9   sfkas.jpg

ステップ2のおかげで私の問題は何ですか...

4

0 に答える 0