Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can we insert 100 records @ a time without using for loop into the databse

Answers were Sorted based on User's Feedback



How can we insert 100 records @ a time without using for loop into the databse..

Answer / answerme

If we need to copy data from one table to another we may
use "insert into" statement.

Please elaborate the qusetion, from where do we need to
insert the records?

Is This Answer Correct ?    14 Yes 2 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / raja

simply you can use sqlbulkcopy to copy entire set to
database.

or

send datatable as a parameter to the stored procedure, in
SP simply u can merge the table with actual table.

Is This Answer Correct ?    8 Yes 0 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / vinodh kumar

if you are inserting values from another table. then you can use this.

insert into table name
select <columns> from <table1>

Is This Answer Correct ?    4 Yes 0 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / vimal

use Bulk Copy

Is This Answer Correct ?    2 Yes 0 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / harshal parab

We can insert multiple records using a xml string.
This will also save the roundtrips to the database.

Is This Answer Correct ?    0 Yes 0 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / natraja

convert your data as XML and use OpenXML concept in your sp

Is This Answer Correct ?    2 Yes 2 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / gaurav verma

To make insert query and with the excel sheet you can also
insert the record at a time.

Is This Answer Correct ?    1 Yes 2 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / sudhir

By use of SQLcommandbuilder, Sqldataadapter and Dataset u can direct update or insert whole datatable or dataset onto database by useinf sqldataadapter.update(datatable/dataset) method

Is This Answer Correct ?    1 Yes 2 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / varsha motwani

You can use "Update()" method of DataAdapter which will
accept Dataset


DataAdapter.Update Method (System.Data.Common).
This will internally call loop for insertion and it will
hit the database evry time for each record.
Another way is to aceppt input as string and pass record in
form of XML and parse the XML in stored procedure and
perform Insert

Is This Answer Correct ?    1 Yes 3 No

How can we insert 100 records @ a time without using for loop into the databse..

Answer / kiran tukaram mandhare

or use while loop to insert those record

OR


u can use file uploader to do this
as u can create a .csv file of those 100 records and just
upload this file in runtime and using button click event
just write the code using file stream reader to insert
those records into database



Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More C Sharp Interview Questions

can you create a function in c# which can accept varying number of arguments

0 Answers   Cognizant,


Define multicast delegate in c#?

0 Answers  


Why are strings immutable in c#?

0 Answers  


If all code is written in a try block and write a catch block with Exception type Exception .In that scenario will all the exceptions catched by that catch block? or any exceptions which will not be caught?

3 Answers   Honeywell,


What is #region in c#?

0 Answers  


What is using in c#?

0 Answers  


What is the difference between namespace and class?

0 Answers  


Can interface have virtual methods in c#?

0 Answers  


What is a system lock?

0 Answers   KEN Group, Wipro,


Why are strings immutable c#?

0 Answers  


Why main method is static in c#?

0 Answers  


How do destructors and garbage collection work in c#?

0 Answers  


Categories