Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:722940
More Search Options
RSS Available
Matching Posts
Re: Import excel sheet to sql server existing table
Hi Limno, [quote user="limno"]ou need column names in your excel to match with your table columns. [/quote] I didn't know i had to have columns names in the excel file. With some changes of your code, i finally got it work. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Connection String to Excel Workbook Dim excelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Fornecedores_SMG.xls;Extended
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/4/2009
Re: Import excel sheet to sql server existing table
Hi Limno, I converted your code to VB net. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Connection String to Excel Workbook Dim excelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\nuno.ferreira\Ambiente de trabalho\Dianicol\Dados- SMG - Fornecedores.xls;Extended Properties=""Excel 8.0;HDR=YES;""" ' Create Connection to Excel Workbook Using connection
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Re: Import excel sheet to sql server existing table
Hi Stanley, I couldn't get it to work. I get an error on this line: cmd.Parameters.Add("@FilePath", SqlDbType.VarChar).Value = FolderPath(+FileName). It says "Conversion from string "Fornecedores.xls" to type 'Double' is not valid."
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Re: Import excel sheet to sql server existing table
Hi i already tried something like that, but it gives this error: Cannot create an instance of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Re: Import excel sheet to sql server existing table
Hi Isra, [quote user="israa17"]hi, sqlbulkcopy is the fastest way to import data from excel to database but i guess won't work with an extra column in the database[/quote] Why do say that with the extra column it problably won't work? For what i can see, i add to mattch the columns of the table with eht excel files. Ididn't quiet understand your code. i converted to vb.net and it gave me lot's of errors. I don't want the excel file converted to a gridview. I wanted inserted
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Re: Import excel sheet to sql server existing table
Hi Limno, The code you posted is exaclty the same has i had posted before. it still gives me the same error on thi sline: Using dr As System.Data.OleDb.OleDbDataReader = command.ExecuteReader()
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Re: Import excel sheet to sql server existing table
I even tried your C code, but it has errors.....and i don't know how to fix them
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Re: Import excel sheet to sql server existing table
My code is: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Connection String to Excel Workbook Dim excelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Files\Fornecedores.xls;Extended Properties=""Excel 8.0;HDR=YES;""" ' Create Connection to Excel Workbook Using connection As New System.Data.OleDb.OleDbConnection(excelConnectionString) 'List columns you need from the Excel
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Re: Import excel sheet to sql server existing table
No, in my excel file the first row is already information. ColumnA Column B john 27 Andrew 15 David 14
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 12/2/2009
Import excel sheet to sql server existing table
Hi everyone, I don't know if this is the correct forum to post this question, but it isn't, please let me know where to post. I'm trying to import a excel file, one sheet, to an sql server. I already have the table created, so i just wanted to fill the columns. The problem is when i import the excel file, it always creates me a new table, when all i wanted, was just fill the existing table with the data of the file. The table in the database has just one more column then the the excel
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
wop_nuno
on 11/30/2009
Page 1 of 31 (303 items) 1
2
3
4
5
Next >
...
Last »
ASP.NET:
High CPU in .NET app using a static Generic.Dictionary
TechNet Edge:
Deploying Silverlight - Why and How
WindowsClient:
Windows Client Developer Roundup for 12/21/2009
Silverlight:
4 Calendars & Plans for 2010 / 5770
ASP.NET:
ASP.NET MVC 2 and Visual Studio 2010
ASP.NET:
Moving your ASP.NET Application to Windows Azure – Part II
Silverlight:
HVP – Core Scaffolding and Updated News
Channel 9:
TWC9: 2009 - The Year in Review
ASP.NET:
Tip#100: Did you know… How to view ASP.NET trace information?
ASP.NET:
Passing anonymous objects to MVC views and accessing them using dynamic
Channel 9:
Channel 9 Live at PDC09: Coding 4 Fun
Channel 9:
Channel 9 Live at PDC09: Stephen Toub
WindowsClient:
Mouse Gestures for Internet Explorer
Channel 9:
Controlling concurrency in Rx
Channel 9:
Dev Tools Ecosystem Summit Videos Available
WindowsClient:
Using Cerebrata's Cloud Storage Studio To Download IIS logs from Multiple Instances of Windows Azure
TechNet Edge:
TechNet Radio: Office 2007 Setup and Configuration (Part 1)
Channel 10:
How-To: Listen to Your Zune Pass Music on Your WinMo Phone
Channel 10:
Share Your Screen with SharedView
Channel 10:
Get Microsoft Tinker Game For Free
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online