oledb

How to import an Excel file into SQL Server? [closed]

风格不统一 提交于 2020-01-09 09:23:01
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . What is the quickest way of getting my Excel file into a table in SQL Server? 回答1: There are many articles about writing code to import an excel file, but this is a manual/shortcut version: If you don't need to import your Excel file programmatically using code you can do it very

Access 2007 - INSERT and instant SELECT doesn't retrieve the inserted data

丶灬走出姿态 提交于 2020-01-09 05:39:16
问题 I'm inserting a few rows in a table via OleDB, and select instantly the inserted row. I can't retrieve the row in this way, i have to wait for approx. 3-5 seconds. And then the inserted row appears in the table. I observed this behavior in the database itself, i inserted the row via OleDB and watched the opened table in Access. The row appeared 3-5 seconds later in the table. Does Access buffer rows? Do i have to send a flush or commit, etc. via OleDB ? Any suggestions would be very helpful.

Access 2007 - INSERT and instant SELECT doesn't retrieve the inserted data

半城伤御伤魂 提交于 2020-01-09 05:39:05
问题 I'm inserting a few rows in a table via OleDB, and select instantly the inserted row. I can't retrieve the row in this way, i have to wait for approx. 3-5 seconds. And then the inserted row appears in the table. I observed this behavior in the database itself, i inserted the row via OleDB and watched the opened table in Access. The row appeared 3-5 seconds later in the table. Does Access buffer rows? Do i have to send a flush or commit, etc. via OleDB ? Any suggestions would be very helpful.

code asp.net c# oledb, cookies, if else

梦想的初衷 提交于 2020-01-07 11:40:13
问题 Can somebody help understand this code? protected void Page_Load(object sender, EventArgs e) { Database database = new Database(); OleDbConnection conn = database.connectDatabase(); if (Request.Cookies["BesteldeArtikelen"] == null) { lbl_leeg.Text = "Er zijn nog geen bestelde artikelen"; } else { HttpCookie best = Request.Cookies["BesteldeArtikelen"]; int aantal_bestel = best.Values.AllKeys.Length; int[] bestelde = new int[aantal_bestel]; int index = 0; foreach (string art_id in best.Values

Best way to close Access Jet OledbConnection

喜夏-厌秋 提交于 2020-01-07 02:32:09
问题 In my winform application - framework 3.5 sp1 - I have a custom Data-Reader. I have to choose the way to close the connection First way: Private cn As OleDb.OleDbConnection = Nothing Public Sub Open() cn = New OleDb.OleDbConnection(sConnectionString) cn.Open() ' ... End Sub Public Sub Close() ' ... cn.Close() cn.Dispose() End Sub Second way: Public Sub Open() Dim cn As New OleDb.OleDbConnection(sConnectionString) cn.Open() ' ... End Sub Public Sub Close() ' ... End Sub In the second way is

VB.Net - Inserting data to Access Database using OleDb

孤街浪徒 提交于 2020-01-07 01:49:44
问题 Can you please tell me what's wrong with the code I'm using? Everytime I execute this, it throws the exception (Failed to connect to database) Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim conn As New System.Data.OleDb.OleDbConnection() conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\socnet.accdb" Dim sql As String = String.Format("INSERT INTO login VALUES('{username}','{password}','{secques}','{secans}')", txt

How to query a Foxpro .DBF file with .NDX index file using the OLEDB driver in C#

大憨熊 提交于 2020-01-06 14:58:35
问题 I have a Foxpro .DBF file. I am using OLEDB driver to read the .DBF file. I can query the DBF and utilize its .CDX index file(cause it is automatically opened). My problem is that I want to query it with the .NDX index file (which is not automatically opened when the .DBF is opened). How can I open the .NDX file in C# using OLEDB driver cause the DBF is really big to search for a record without the index? Thanks all! Here is the code I am using to read the DBF. OleDbConnection oleDbConnection

How to query a Foxpro .DBF file with .NDX index file using the OLEDB driver in C#

风流意气都作罢 提交于 2020-01-06 14:58:19
问题 I have a Foxpro .DBF file. I am using OLEDB driver to read the .DBF file. I can query the DBF and utilize its .CDX index file(cause it is automatically opened). My problem is that I want to query it with the .NDX index file (which is not automatically opened when the .DBF is opened). How can I open the .NDX file in C# using OLEDB driver cause the DBF is really big to search for a record without the index? Thanks all! Here is the code I am using to read the DBF. OleDbConnection oleDbConnection

Check for either ADO.NET / OLEDB Connection presence and then insert to DB

Deadly 提交于 2020-01-06 07:46:22
问题 I originally posted the question to check for presence of either ADO.NET/OLEDB connection types. That being resolved, I'd like to know, how to change the code when it comes to inserting to the DB. For example, when the connection type is ADO.NET we use the "Transaction" in the connection type. SqlConnection connection = (SqlConnection)connections[_connectionName].AcquireConnection(transaction); Now if I have the OLEDB connection (instead of ADO.NET), I'd like to handle that situation in this

Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt

依然范特西╮ 提交于 2020-01-06 07:23:12
问题 I have the following connection string using ado.net String ConectionString=@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Data.accdb; Jet OLEDB:Database Password=mypassword;" I faced the problem Microsoft.ACE.OLEDB.12.0 is not registered on local Machine I solved it By installing 64 version of the Microsoft Access Database Engine 2010. And edit Build Properties to x 86 But it never worked so I had to install 2007 Office System Driver :Data Connectivity components When I installed the