title: Fill SQL-SERVER table from an excel file
body: <p>I tried to fill a SQL SERVER table using Python by executing the Python script below :</p>
  
  <pre><code>import pyodbc 
  import pandas as pd
  from pandas import ExcelWriter
  from pandas import ExcelFile
  
  df = pd.read_excel('C:/Users/Username/Desktop/file1.xlsx', sheet_name='Sheet1')
  cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};"
                        "Server=MYSERVERNAME;"
                        "Database=DB;"
                        "uid=sa;pwd=MYPWD;"
                        "Trusted_Connection=yes;") 
  
  print("Column headings:")
  print(df.columns)
  '''
  for i in df.index:
      print(df['Last Name'][i],df['First Name'][i] )
  '''
  cursor = cnxn.cursor()
  for i in df.index:
  cursor.execute("insert into pyperson (id,firstname,lastname) values (df['ID'][i],df['First Name'][i],df['Last Name'][i])") 
  cnxn.commit()  
  </code></pre>
  
  <p>PS:</p>
  
  <pre><code>If I try to read only data from excel file and then print it it works fine
  if I try to insert directly with an insert into statement using python it works also fine 
  </code></pre>
  
  <p>but when I combine them it shows me the error message below :</p>
  
  <blockquote>
    <p>IndentationError: expected an indented block</p>
  </blockquote>
  
  <p>Any ideas,Any help :) </p>