title: Read data from excel in asp.net
body: <p>I want to read a whole excel sheet's data in a single textbox.</p>
  
  <p>Is this possible?</p>
  
  <p>I know the code to read a cell's data from excel to a textbox.</p>
  
  <pre><code>PrivateSub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
  
      Dim xlaTest As Excel.Application = CType(CreateObject("Excel.Application"), Excel.Application)
      xlaTest.Visible = True
      Dim wbkTest As Excel.Workbook = xlaTest.Workbooks.Open("D:\Tests\VBTrials\ExcelTests\TestWorkbook.xls")
      Dim wshTest As Excel.Worksheet = DirectCast(wbkTest.Worksheets("Sheet1"), Excel.Worksheet)
      TextBox1.Text = wshTest.Range("B2").Value
      wbkTest.Close()
      xlaTest.Quit()
  
  EndSub
  </code></pre>