473,516 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

urgent-transferrring data from excel to sqlserver using webforms

23 New Member
hi all
can somebody plzz tell me how to transfer data from excel 2003 to sql server 2000 using webforms.

I have a table in excel and i want to transfer the entire data into sqlserver table...how can i do it plzzz help me
Nov 21 '07 #1
6 1173
mzmishra
390 Recognized Expert Contributor
This link will help you
http://forums.asp.net/p/1132513/1821793.aspx
Nov 21 '07 #2
dip_developer
648 Recognized Expert Contributor
hi all
can somebody plzz tell me how to transfer data from excel 2003 to sql server 2000 using webforms.

I have a table in excel and i want to transfer the entire data into sqlserver table...how can i do it plzzz help me
Fill a dataset with the excel records with the following code............now I think rest (inserting records into database from dataset)will be done easily

Expand|Select|Wrap|Line Numbers
  1. Dim conStr As String = "provider=Microsoft.Jet.OLEDB.4.0;data source=" + fileName + "; Extended Properties=Excel 8.0;"
  2.                     Dim sql As String = "select * from [Sheet1$]" '-------- "Sheet1" is the name of the excel sheet
  3.                     MyConnection = New System.Data.OleDb.OleDbConnection(connectionstring)
  4.                     MyConnection.Open()
  5.                     MyAdapter = New System.Data.OleDb.OleDbDataAdapter(sql, MyConnection)
  6.                     Dim myDataSet As DataSet = New System.Data.DataSet
  7.                     MyAdapter.Fill(myDataSet)
Nov 21 '07 #3
tanya2001
23 New Member
Fill a dataset with the excel records with the following code............now I think rest (inserting records into database from dataset)will be done easily

Expand|Select|Wrap|Line Numbers
  1. Dim conStr As String = "provider=Microsoft.Jet.OLEDB.4.0;data source=" + fileName + "; Extended Properties=Excel 8.0;"
  2.                     Dim sql As String = "select * from [Sheet1$]" '-------- "Sheet1" is the name of the excel sheet
  3.                     MyConnection = New System.Data.OleDb.OleDbConnection(connectionstring)
  4.                     MyConnection.Open()
  5.                     MyAdapter = New System.Data.OleDb.OleDbDataAdapter(sql, MyConnection)
  6.                     Dim myDataSet As DataSet = New System.Data.DataSet
  7.                     MyAdapter.Fill(myDataSet)

hi can u plz elaborate the code more plzz coz m all new 2 .net so i dunno much abt it...so can u plz...my excel sheet name is sheet1 and sql table name is table5
Nov 21 '07 #4
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
hi,
the code given by dip_developer indicates pretty clearly that a dataset with the values of your excel file will be contained in it.
now its upto you to transfer them to the sql server, because you are the best who knows about the schema of your database and the schema of the excel file
Nov 21 '07 #5
tanya2001
23 New Member
hi,
the code given by dip_developer indicates pretty clearly that a dataset with the values of your excel file will be contained in it.
now its upto you to transfer them to the sql server, because you are the best who knows about the schema of your database and the schema of the excel file
i wanted to know tht the below code shows the connection string for excel
Dim conStr As String = "provider=Microsoft.Jet.OLEDB.4.0;data source=" + fileName + "; Extended Properties=Excel 8.0;"

abd now here below agn asks for d same excel connection...where do v have 2 give the sql connection string
MyConnection = New System.Data.OleDb.OleDbConnection(connectionstring )
Nov 21 '07 #6
dip_developer
648 Recognized Expert Contributor
i wanted to know tht the below code shows the connection string for excel
Dim conStr As String = "provider=Microsoft.Jet.OLEDB.4.0;data source=" + fileName + "; Extended Properties=Excel 8.0;"

abd now here below agn asks for d same excel connection...where do v have 2 give the sql connection string
MyConnection = New System.Data.OleDb.OleDbConnection(connectionstring )
extremely sorry friend.........the variable name connenctionstring would be conStr or vice versa....both are same........

sorry for that mistake....I should be more watchful while replying............
Nov 22 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1369
by: Johnson Ndiovu | last post by:
This is a multi-part message in MIME format --af4b847f-30bf-4b8d-acf1-2909de953a6e Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable DEAR FRIEND, BUSINESS TRANSACTION. MY NAME IS JOHNSON NDIOVU, THE ELDEST SON OF MR.AKUGA NDIOVU OF ZIMBAWE IT =
3
2403
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is actually the name of a form element on the parent window. On the new page, I have this javascript: ---- var var2 = location.search.substring(9);...
28
3001
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
2894
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException:...
33
3364
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
8
2753
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written partially in c and partially in fortran. I guess i need to change host specific files to make it working. I wonder if standard header files are...
1
1904
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this socket. some time error is---"An existing connection was forcibly closed by the remote host" and some time error is--- "A connection attempt failed...
17
2267
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all scripts. each when clicked i am able to run the script. so HOW and what do i do to call and run the .sql Thanks
1
2102
by: rajesh.us.it.recruiter | last post by:
Hi Guys/Partners, We have a URGENT Requirement for Perl Programmer with H1 visa in India/US for one of our prestigious Client. Location : New Jersey Requirements : Should be very strong in Perl Should be strong in SQL, Unix, C++ Should have some knowledge in RDBMS
7
5946
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find it? If not, how do I have to change my deployment strategy? Thanks!
0
7276
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7581
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.