hi friends...i am developing a small windows application in vb.net using visual studio 2005.
i want to design a form where user can enter multiple records.like we want to design a "bill" form where user can create the bill for any no of items.there are 4 colmns in it : item no , item name , quantity , price.

my requirement is that if user user a particular item from the list of item in first column then the column "item name" get filled automatically from the database.
then user can enter qty , price for that item.on clicking a save button all the data entred by user should get saved in a table in SQL database.

now user can create bill for 1,2 or more items. so no of rows are variable.

HOW could i achieve this using vb.net and SQL server 2005 as databse.

>HOW could i achieve this using vb.net and SQL server 2005 as databse.

Firstly, create a DataTable with four columns.

Dim dt as new DataTable

 dt.Columns.Add("ItemNo",getType(integer))
 dt.Columns.Add(Item")
 dt.Columns.Add("Qty",GetType(Integer))
 dt.Columns.Add("Price",GetType(Integer))

Add some rows into datatable object.

dt.Rows.Add(10,"Item1",1,2)
...

Finally write a code which insert each row from the datatable into the database.

thnx for ur reply.but friend I have to take input from user.I am not usure how to do that. i cannt use several textboxes and then save them to datatable.

i want something like grid appears and then user enter the data and the whole data get saved to table in database. I am not talking about updating data in grid.

>HOW could i achieve this using vb.net and SQL server 2005 as databse.

Firstly, create a DataTable with four columns.

Dim dt as new DataTable

 dt.Columns.Add("ItemNo",getType(integer))
 dt.Columns.Add(Item")
 dt.Columns.Add("Qty",GetType(Integer))
 dt.Columns.Add("Price",GetType(Integer))

Add some rows into datatable object.

dt.Rows.Add(10,"Item1",1,2)
...

Finally write a code which insert each row from the datatable into the database.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.