none
Creating a Master detail form using c#

    Question

  • Hello experts,
    Good day. I want to create a Master detail form using Visual Studio 2008 windows application with c#. In Parent Key table I want to input via Text Box, Combo box etc. and in Child Key table I want to Input data from datagrid. Now How can I Insert, Edit, delete, fetch data by grid. I don't want to use DataAdaptar. Have any alternative process. If have pls help me asap. I want to use Stored Procedure to Insert, Edit, Delete, fetch data into database.

    Thanks
    Sunday, November 08, 2009 7:12 PM

Answers

  • Hi,

     

    There is a FAQ tells about master-details.

    How do I show master-details?

     

    Create relationship between master and details tables in a DataSet. The “master” control bindingsource is dataset, datamember is the master table. The details control bindingSource should be the master control’s bindingsource, datamember is the relationship name.

     

    -> How can I Insert, Edit, delete, fetch data by grid. I don't want to use DataAdaptar. ………I want to use Stored Procedure to Insert, Edit, Delete, fetch data into database.

     

    It’s the same as update a single datatable. Set command.CommandType to CommandType.StoredProcedure. Set command.commandText to stored procedure name. Then execute the command.

    This is an example shows calling Stored Procedure:

    HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET

     

    Best regards,

    Ling Wang


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Jing0Moderator Monday, November 16, 2009 6:25 AM
    Sunday, November 15, 2009 3:57 PM
    Moderator