user1986144
user1986144

Reputation: 105

Gridview with textfields

hello how to do a gridview lik this

hello, i want to create a grid view from two tables in database. and bind it together and update it another table in the database. Customer_Name is one column from BillingData table and Group_Name is another column from GroupMapping. and the remaining fields should be text fields where use can enter the values.

Upvotes: 0

Views: 110

Answers (2)

Zo Has
Zo Has

Reputation: 13038

You have a couple of things to work out.

  1. First, you need to create a business object/DTO for your save operation
  2. Then, you have to write SQL for the insert, update & select operations (Use 'joins' for joining your related tables)- I would recommend you to user an INNER JOIN SQL Join W3School
  3. You can then bind your gridview on presentation layer & either opt for bulk editing through gridview or use a separate form for insert & update operation

Damien.

Upvotes: 1

Maris
Maris

Reputation: 4776

You should enter DTO Object. Something like that:

class Program
{
    static void Main(string[] args)
    {
        A a = new A();
        B b = new B();
        ABDto abDto = new ABDto(a, b);

    }


}

public class A
{
    public Int32 Id { get; set; }
    public String Name { get; set; }
}

public class B
{
    public Int32 Id { get; set; }
    public String Name { get; set; }
}

public class ABDto
{
    public Int32 Id { get; set; }

    public String AName { get; set; }

    public String BName { get; set; }

    public ABDto(A a, B b)
    {
        AName = a.Name;
        BName = b.Name;
    }
}

Upvotes: 0

Related Questions