How to insert multiple records through gridview i am using sql server 2008 and this ia store procedure.
create proce
@InvoiceNo int
as
insert into tbl_school(id) values (@InvoiceNo)
Your question is unclear; however, in the case of a stored procedure that takes one int
as a parameter and does an insert
, there is no "bulk" approach here: you just need to call the stored procedure lots of times (once per record). If you have flexibility to modify the design, alternative options include:
[n]varchar(max)
that you then pull apart (usually via a "split" udf) to do the insert SqlBulkCopy
(raw TDS insert, not using a stored procedure) However: how you get from your gridview to the data-layer is mostly a design and implementation detail for your code.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.