Click here to Skip to main content
12,632,234 members (26,810 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
I want a excel sheet which have all major location in India, combined with all Major city,
because i want use All Location In my Project, so i import Excel file in my Sql Data base,

So if you Have List Of All Location In database(or excel sheet) Then Plz Give Me SCrip Of data base
Posted 22-Nov-12 22:34pm
Comments
Richard MacCutchan 23-Nov-12 6:32am
   
There are plenty of places where you could find this for yourself, probably on one of the Indian Government websites.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I did the hardwork for you. I found the list here[^]

Now its your turn to do the easy work of putting it in the excel or database.
  Permalink  
v2
Comments
Abhishek Pant 23-Nov-12 7:12am
   
+5,excellent work here..
aspnet_regiis -i 23-Nov-12 8:08am
   
Thank you Abhishek :)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Use Distributed Queries

If you do not want to configure a persistent connection to the Excel workbook as a linked server, you can import data for a specific purpose by using the OPENDATASOURCE or the OPENROWSET function. The following code samples also import the data from the Excel Customers worksheet into new SQL Server tables:

SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\test\xltest.xls;Extended Properties=Excel 8.0')...[City$]

SELECT * INTO XLImport4 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', [City$])

SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [City$]')

C:\test\xltest.xls - is the full path of the excel file
XLImport3,XLImport4,XLImport5 - are the newly created tables
City$ - name of sheet on the excel file
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 25 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100