FAQ Database Discussion Community

Creating OleDBConnection

I am migrating code from VS2010 to VS2013 and my syntax in VS2010 shows compile errors in 13?!? Can someone assist me with why these two compile errors are being thrown? Syntax error, ',' expected { expected And this is the syntax that works w/o issue in 10. public static...

OleDbException summing two fields within an SQL query C#

I am using a OleDbConnection in c# my query is : "SELECT [City],[Column1]+[Column2] FROM [Issuer$] WHERE ([Column1] > 1) GROUP BY [City]" I always receive the error ERROR : You tried to execute a query that does not include the specified expression 'Column1+Column2' as part of an aggregate function. My...

How to specify string path for opening excel file?

How would I go about specifying a string path for opening a excel file knowing that the excel file's file name will always change or at least plug in the most recent saved excel file in that folder to the string path? For example, string PATH = @"C:\myFileNameWillAlwaysCHange.xlms or mostRecentFile.xlms";...

How to update an table in oracle db using oledbconnection from asp.net c# code

I am trying to update an table in oracle 11g database from c# code using an oledbconnection. The query formation is ok and then hangs at execute. No error or exception is thrown. Its like an endless loop. Select and insert query are working fine but update fails.

OleDbConnection to MS Access: SQL query like clause with escape characters and wildcards

There must be some very obvious answer but i just can not see it nor find solution from web. I try to count from db table how many rows contains file path LIKE "path". In Access Settings-table I have rows where path field (short text type) containing string: \\server\dir\something\ I...

SQLGetInfo - How to use this function

I have developed a c# application which connects to many types of database servers like Sql,Oracle,Mysql etc..Connection was established using ODBC. I need to find the server type (DBMS type) for which the connection was established, as the user only enters the DSN name. After several hours of surfing, I...

The microsoft.jet.OLEDB4 provider is not registered on the local machine

I am trying to develop a kind of Windows form application using Visual Studio 2013. In my project I have such a code like this : public class AccessFile { string strconnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=AccessTemp.mdb"; private void InsertSellItems(List<TTMSModel> lstttms ) { try { foreach (TTMSModel t in lstttms) { if...

The Microsoft Office Access database engine cannot open or write to the file ''

Data needs to be read into .net gridview from excel worksheet. Here are the aspx and aspx.cs codes. ASPX: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Read and Display Data From an Excel File (.xsl or .xlsx) in ASP.NET</title> </head> <body> <form id="form1" runat="server"> <div>...

Use OldeDbConnection to read excel sheet using 9th row as the column names?

I'm trying to read an excel sheet using oleDbConnection and OleDbDataAdapter and then filling a DataSet with that information. What i need to figure out how to do is ignore the first 8 rows in the excel sheet and read it as if the 9th row was the first row,...


I'm trying to create a method that will allow me to simply pass an SQL Command to a database with ease. I keep running into this error for some reason though. The full string is this Couldn't fetch the required data. Update unable to find TableMapping['tables'] or DataTable 'tables'. My...

Code not following sequential order in source

I have a settings form, on which lies a combobox that I would like to fill on load of the form with data returned from an access database. Where I'm having difficulty is actually setting the combobox's datasource - when the program executes, it jumps from filling the OleDbDataAdapter to...

The SLXOLEDB.1 provider is not registered on the local machine

I'm building a REST web service in WCF. When I run the WCF project from Visual Studio, everything works fine. Calling the 'Post' method on a specific endpoint works just fine. But when I try to run the same web service from the IIS Manager, calling the same method on...