oledb

Any ole db provider/consumer for PostgreSQL?

自闭症网瘾萝莉.ら 提交于 2020-01-15 10:16:17
问题 I'm working with c++ visual studio 2015, currently i'm using sql server for database but now i'm switching on postgres DB but i'm not getting any relevent OLE DB consumer/provider please suggest. 回答1: You can either work with PGNP OLEDB Provider for PostgreSQL, Greenplum and Redshift or use a combination of Microsoft OLE DB Provider for ODBC and psqlODBC. Although the second combination involves more components (and, probably, more layers), it's probably more up-to-date. 来源: https:/

Import excel sheet using jet.oledb.4.0 , setting first row as column name

丶灬走出姿态 提交于 2020-01-15 03:08:27
问题 i am trying to import an excel file into a datatable in using Jet.Oledb . Here is my code: string sourceConstr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + HttpContext.Current.Server.MapPath("~/" + fileName) + "';Extended Properties='Excel 8.0;HDR=No;IMEX=1'"; OleDbConnection con = new OleDbConnection(sourceConstr); OleDbCommand oleDbCmd = new OleDbCommand(); con.Open(); oleDbCmd.Connection = con; DataTable dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); string

OleDbConnection() opens an Excel file in any open Excel window. But does not if there isnt a window open

亡梦爱人 提交于 2020-01-14 08:41:08
问题 I am writing an application which uses an OleDbAdapter to access information in an Excel file. When I try to create a connection to the Excel file if the user has another (unrelated) Excel file open on their desktop then the file being connected to by the adapter opens in this window in Read-Only format. If the user does not have an instance of Excel open then the files stay hidden. Here is my code: foreach (item app in apps) { DataTable dt = new DataTable(); string CnStr = ("Provider

Omit named parameters from OleDbCommand [closed]

最后都变了- 提交于 2020-01-14 07:11:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have a Simple stored procedure which takes 6 paramters. Lets say they are @a, @b, @c, @d, @e, @f and they are all optional with the default value of null . I need to know how to call the stored procedure with only some of these parameters. I know the general steps: Define a connection and Open it. Define a

C#.Net, Get the OLEDB provider version

Deadly 提交于 2020-01-13 11:06:49
问题 I need to Identify the Installed OLEDB provider version. before reading an Excel file. How can I do that? 回答1: You can use the OleDbEnumerator.GetElements Method . http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbenumerator.getelements.aspx to enumarate the drivers. You ask the versions of them maybe this link helps: http://dotnetref.blogspot.com/2009/04/getting-version-of-oledb-provider.html 回答2: Have a look in the registry and see if the Jet OLE DB provider is there The Path

C#.Net, Get the OLEDB provider version

一曲冷凌霜 提交于 2020-01-13 11:06:13
问题 I need to Identify the Installed OLEDB provider version. before reading an Excel file. How can I do that? 回答1: You can use the OleDbEnumerator.GetElements Method . http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbenumerator.getelements.aspx to enumarate the drivers. You ask the versions of them maybe this link helps: http://dotnetref.blogspot.com/2009/04/getting-version-of-oledb-provider.html 回答2: Have a look in the registry and see if the Jet OLE DB provider is there The Path

How do I extract the data in a FoxPro memo field using .NET?

核能气质少年 提交于 2020-01-13 05:29:31
问题 I'm writing a C# program to convert a FoxPro database to XML, and everything works except the memo field is blank. Is there something I'm missing to convert that bit? I'm using C# .Net 3.5 SP1, Visual FoxPro 9 SP 1 OLE DB Driver. Connection string is okay, as all other data is being pulled properly. When I converted the FoxPro database to SQL Server, the memo field is also blank there, so I can't convert twice. 回答1: Ended up having to do some work myself, but maybe it can help someone else

Does DDE still matter? Which are the alternatives?

南楼画角 提交于 2020-01-12 04:51:09
问题 I'm working on a stock exchange information platform and we are thinking in provide a link between our platform and home-made Excel files. The financial market is still bound to the old DDE server approach, now does it still matter today? Which are the alternatives to make automatic online data updates on Excel files, OLE DB queries? I wonder if anyone has any example of implementing an OLE DB provider in C# and .NET. Our API will be completely online and RESTful, there is any Web Services

Trouble with INSERT INTO statement

故事扮演 提交于 2020-01-11 12:14:55
问题 I can't seem to figure out why I keep getting a Syntax error in INSERT INTO statement . The code is below. static void ABSChangeEventsTable(string ControlNumber, string CurrentStatus) { using (var connection = new OleDbConnection(strAccessConnAbstracting)) using (var command = connection.CreateCommand()) { connection.Open(); command.CommandText = "INSERT INTO Events (Date_Time, Details, Regarding, User, Control_Number) VALUES (@Date_Time, @Details, @Regarding, @User, @Control_Number)";

Cant create Excel file using OLEDB C#

 ̄綄美尐妖づ 提交于 2020-01-11 11:36:54
问题 string TempFileLocation="Filelocation"; string tempfilename ="FileName"; string TabName ="TabName"; string xConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" +TempFileLocation+ tempfilename +".xls;Extended Properties='Excel 8.0;HDR=YES'"; var conn = new OleDbConnection(xConnStr); string ColumnName ="[columename] varchar(255)" conn.Open(); var cmd = new OleDbCommand("CREATE TABLE [" + TabName + "] (" + ColumnName + ")", conn); cmd.ExecuteNonQuery(); conn.Close(); I using above