Click here to Skip to main content
Rate this: bad
good
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 21:34pm
Comments
Richard MacCutchan at 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 at 23-Nov-12 7:12am
   
+5,excellent work here..
aspnet_regiis -i at 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
0 Schatak 394
1 OriginalGriff 340
2 _Amy 115
3 Abhijit Ghosh (Subho) 115
4 Andreas Gieriet 100
0 OriginalGriff 7,107
1 Sergey Alexandrovich Kryukov 5,623
2 Maciej Los 3,504
3 Peter Leow 3,373
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 25 Nov 2012
Copyright © CodeProject, 1999-2014
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