将数据源从aspx传输到aspx.vb

时间:2013-11-20 16:14:10

标签: asp.net vb.net gridview

我只是想知道如何在这个网页背后的代码aspx.vb中编写这个数据源。

<asp:SqlDataSource ID="partsUsed" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    DeleteCommand="DELETE FROM [fact_parts_used] WHERE [parts_used_id] = @parts_used_id"
    InsertCommand="INSERT INTO [fact_parts_used] ([wo_id], [part_id], [quantity]) VALUES (@wo_id, @part_id, @quantity)"
    SelectCommand=" SELECT * FROM 
                        (SELECT parts_used_id, dim_users.[user_name], full_name, 
                        wo_id as tasks, wo_id,
                        fact_parts_used.part_id, dim_parts.part_number+' '+ dim_parts.part_desc as Part, quantity, cost 
                        FROM fact_parts_used
                            INNER JOIN dim_users ON dim_users.[user_id] = fact_parts_used.[user_id]
                            INNER JOIN dim_parts ON dim_parts.part_id = fact_parts_used.part_id
                        ) a
                    WHERE wo_id is not null AND tasks = wo_id"
    UpdateCommand="UPDATE [fact_parts_used] SET [part_id] = @part_id, [quantity] = @quantity, cost = @cost WHERE [parts_used_id] = @parts_used_id" 
    >
    <SelectParameters>

    </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="parts_used_id" Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="part_id" Type="Int32" />
        <asp:Parameter Name="quantity" Type="Int32" />
        <asp:Parameter Name="parts_used_id" Type="Int32" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter Name="wo_id" Type="Int32" />
        <asp:Parameter Name="part_id" Type="Int32" />
        <asp:Parameter Name="quantity" Type="Int32" />
    </InsertParameters>
</asp:SqlDataSource>

0 个答案:

没有答案