Hi... I am developing a project called Info Dial....I got stuck at a place where i have to store an excel sheet into a database that can be displayed in a grid view....thats working fine for a single Excel sheet...but what if i have more than one excel shhets :( ??How can i overcome this problem? I have my code as shown.... if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.ContentLength > 0) { string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName); string savelocation = @"D:\programs\" + fn; FileUpload1.PostedFile.SaveAs(savelocation); string excelConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + savelocation + ";" + "Extended Properties=Excel 8.0;"); // Create Connection to Excel Workbook OleDbConnection connection = new OleDbConnection(excelConnectionString); OleDbCommand command = new OleDbCommand("Select * FROM [Sheet1$]", connection); connection.Open(); // Create DbDataReader to Data Worksheet System.Data.OleDb.OleDbDataReader dr = command.ExecuteReader(); // SQL Server Connection String string sqlConnectionString = "Database=Infodial;server=s156;uid=sa;pwd=sa"; // Bulk Copy to SQL Server SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString); bulkCopy.DestinationTableName = "companydetails"; bulkCopy.WriteToServer(dr); connection.Close(); ScriptManager.RegisterStartupScript(Page, this.GetType(), "alert", "<script>alert('Saved in Database Successfully');</script>", false); } Any code would be appreciated... Thanks in Advance Regards Abhishek.
User 4645177
Posts
-
Importing Data from Excel sheet to the Database -
Regarding Mail Forwarding... [modified]Yes
-
Regarding Mail Forwarding... [modified]Hi all.... I am developing an app....I got stuck a place where i have to send a mail which displays his password to my clients mail id if he forgets his password....How can i achieve this? :( Any example or source code will be appreciated.
modified on Friday, March 7, 2008 12:04 AM
-
Alphabetical order sorting in GridviewHi all... Can u guys help me in how to sort the charecters (Alphabetical sorting)in grid view? My problem is i took a label and a textbox.As soon as i type in a letter in a text box the names starting with that letter should be displayed in the Gridview from the corresponding table in the back end..... Plz help me out its top urgent....!!! Thanks Regards Abhishek
-
Timer ProblemHi All... Can any body say how can we ajaxify the exsiting ASP.Net Site using vb? We need a timer that ticks for every second....but the page is flickering for every second(i put timer interval as 1000ms)... Can any body help us out plllllzzz...... Thanks in advance Regards Nanda Abhishek
-
ASP.Net AJAX Problem With VB.NetThanks for the reply.... The problem is i need an asp.net ajax timer in my website.... I am developing this website using vb.net...as al we know we cannot stop the page flickering(in normal asp.net website)unless we use Ajax... so i wanted to ajaxify my website... so i drag n dropped Update panel,timer,Script manager n label to do this n i have also written the required code in TIMER TICK event.... here comes my problem... the page is again flickering as if it flickers for a normal asp.net page... I also have added all the assemblies that are required for my asp.net web.config file from an asp.net ajax web.config file... I did the same for C#...Worked out then... :( Help me out plzz.... Thanks regards Abhishek Nanda Kumar
-
ASP.Net AJAX Problem With VB.NetHi All... Can any body say how can we ajaxify the exsiting VB.Net Site? We need a timer that ticks for every second....but the page is flickering for every second... we know we can solve it in C#... but how can we in VB? Can any body help us out plllllzzz...... :(( Thanks in advance :) Regards Nanda Abhishek
-
Asp.net AJAX -
Silverlight Installatiion -
Silverlight Installatiionk but the thing is i have VS- 2005 installed in my p.c.... i have downloaded silverlight 1.0 from microsoft site n tried to install it... but its not been installed...what wud be the problem?:(
-
Silverlight InstallatiionDo i need to have VS2008 installed in my p.c for silverlight or can i install it with VS2005 also?
-
Regarding FlashHow can i make my App flash enabled?
-
How can i?How about if i write the following code...? <html><head> <style type="text/css"> .textboxstyle{ background-image:url('http://library.mit.edu/exlibris/aleph/u16\_1/alephe/www\_f\_eng/icon/v-icon-3.gif'); background-repeat: no-repeat; background-position: center left; padding-left: 18px; } </style> </head> <body> <input type="text" name="uname" class="textboxstyle"> </input></body> </html>
-
How can i?Wow...! Thnkyou so much Shah Its working out... :)
-
How can i?How can we insert an image in a textbox... I mean i like to put the image in search textbox.... we can find this in some sites like apple...
-
Sql Server ProblemCan any body reply us What is Collate in SQL? Thanks...in advance :) Regards Nanda Kumar Abhishek
-
Application ErrorHi All... We have done a project called e-banking...we are unable to debug it in another machine....It is throwing an exception in web.config file as stated below... It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level... This error can be caused by a virtual directory not being configured as an application in IIS. Can any one help us out.... plllllzzzzz:( Thanks in advance Regards Nanda Kumar Abhishek
-
Installation Problem Of Silverlight [modified]ok... Thanx :) Regards Abhishek
-
Installation Problem Of Silverlight [modified]i have installed silverlight 1.0sdk
-
Installation Problem Of Silverlight [modified]Hi all... I have downloaded Silver Light from MicroSoft site...But i am unable to install it in my p.c...I have V.S 2005 installed in my p.c.what should i do? plz help... :(
modified on Monday, December 10, 2007 2:18:01 AM