• 0

How Convert Excel Data to Access Database with .NET?


Question

6 answers to this question

Recommended Posts

  • 0

You can just use the Excel file itself, depending on the nature of what you want to do with the data in it, using OleDb

http://support.microsoft.com/kb/311731

Or you can import that data using an access tool built into the application unless I'm mistaken.

  • 0

Check out this thread:

http://www.thescripts.com/forum/thread704418.html

This is another page on how to create an Excel file:

http://www.vbdotnetheaven.com/UploadFile/g...preadsheet.aspx

Also, here's a short snippet of code I found on another forum:

Dim cnn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=mailmerge.xls;Extended Properties=""Excel 8.0;HDR=YES;""")

Dim oDA As New OleDb.OleDbDataAdapter("Select * from [Sheet1$]", cnn)

oDs = New DataSet("TestExcel")
oDA.Fill(oDs)

Edited by IceBreakerG
  • 0

how fill a datagrid with this code?

'first specify the path and filename of your excel
Dim PathFilename As String = "C:\TESTME.xls"
'second is specify the sheet name you want to read
Dim strSheetName As String = "Sheet1"

'create a connection
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DS As System.Data.DataSet
Dim _sqlqry As String
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0amp; _
"data source='" & PathFilename & " '; " & "Extended Properties=Excel 8.0;")
'Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter("selectom [" & strSheetName & "$]", MyConnection)
DS = New System.Data.DataSet
MyCommand.Fill(DS)
MyConnection.Close()
MyConnection.Dispose()
MyConnection = Nothing

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I see you subscribe to the Linux/macOS approach to winning over converts...
    • As we get closer to October 2025 and the end of Windows 10 support, Windows 11 will pick up its pace and soon become the most popular desktop operating system worldwide. That's an assertion. It's also quite possible that the only growth will come from attrition as people and companies buy new machines that only come with Win11. It's also possible that we'll get a literal repeat of Win XP and Win 7, where a large number of users just waited until Microsoft gave in and fixed the core problems that the consumers were complaining about in Win Vista and Win 8 when they released Win 7 and Win 10.
    • It's significant growth for Linux considering the market share, so it could have had that effect I described.
    • Microsoft and Crowdstrike announce partnership on threat actor naming by Pradeep Viswanathan Whenever a cyberattack is discovered, companies disclose it to the public and assign it a unique name based on their internal procedures. Unfortunately, this leads to inconsistencies, as each company has its own naming conventions. As a result, the same threat actor behind a cyberattack may end up with multiple names, causing delays and confusion in response efforts. For example, a threat actor that Microsoft refers to as Midnight Blizzard might be known as Cozy Bear, APT29, or UNC2452 by other security vendors. To address this issue, Microsoft and CrowdStrike are teaming up. These companies will align their individual threat actor taxonomies to help security professionals respond to cyberattacks with greater clarity and confidence. It’s important to note that Microsoft and CrowdStrike are not attempting to create a single naming standard. Instead, they are releasing a mapping that lists common threat actors tracked by both companies, matched according to their respective taxonomies. The mapping also includes corresponding aliases from each group’s naming system. You can view the joint threat actor mapping by Microsoft and CrowdStrike here. Although this threat actor taxonomy mapping is a joint effort between Microsoft and CrowdStrike, Google/Mandiant and Palo Alto Networks' Unit 42 are expected to contribute to this initiative in the future. Vasu Jakkal, Corporate Vice President of Microsoft Security, wrote the following about this collaboration with CrowdStrike: As more organizations join this initiative, the collective defense against cyber threats will undoubtedly be improved.
  • Recent Achievements

    • First Post
      chriskinney317 earned a badge
      First Post
    • Week One Done
      Nullun earned a badge
      Week One Done
    • First Post
      sultangris earned a badge
      First Post
    • Reacting Well
      sultangris earned a badge
      Reacting Well
    • First Post
      ClarkB earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      172
    2. 2
      ATLien_0
      125
    3. 3
      snowy owl
      122
    4. 4
      Xenon
      116
    5. 5
      +Edouard
      93
  • Tell a friend

    Love Neowin? Tell a friend!