.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Inserting Multiple rows in Single Click

Posted By: Dhilip.R     Posted Date: November 26, 2010    Points:2   Category :Sql Server

Hi,Experts

I Have Table TimeTableStudent with column of (Timetableid bigint,classid bigint ,day varchar, FirstHour varchar,SecondHour varchar,.....EighthHour varchar)

Now I want to Insert values of five days(Monday,Tuesday,Wednesday,Thursday,Friday,Saturday) to the table in a single Click

Thanks in Advance
Dhilip.R


Responses
Author: SureshM             
Posted Date: November 27, 2010     Points: 5   

if your requirement is insert for five days only.
you know its not exceed five. so you can write five execute commands into that click event.
like,

first insert for monday:

cmd=i"nsert into TimeTableStudent (values)"
cmd.executenonquery
....
next for tuesday

cmd=i"nsert into TimeTableStudent (values)"
cmd.executenonquery

.......
..... upto firday

Author: Sajid P K             
Posted Date: November 29, 2010     Points: 5   
Author: Syed Shakeer Hussain             
Posted Date: December 02, 2010     Points: 5   

Hi

Hope below Query will Be useful



Insert into TimeTableStudent(col1,col2) Select col1,col2 from TimeTableStudent
Where days IN('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')




Author: Maverick             
Posted Date: March 07, 2011     Points: 20   

You can use bulkcopy feature of sqlserver to insert as many rows u want in a single click as a fast pace.

search o link for bulk copy it is very easy and efficient.

Thanks,
Maverick

Thanks,
Maverick


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend