oledbconnection

Can't update date in aspx to a MS-ACCESS table

两盒软妹~` 提交于 2019-12-25 09:40:53
问题 Hello I'm having problem with updating datatypes I insert the date in the C# part like this string strSQL = "INSERT into Frettir (CreatedBy,CreatedOn,Title,Description,Starts,Ends,CatId,SectionId,ArticleExt,Myndatexti,MyndUrAlbumi,NrMyndar) values(?,?,?,?,?,?,?,?,?,?,?,?)"; cmd.Parameters.Add("@Starts",OleDbType.Date).Value = dstartdate; but I update in the aspx part like this UpdateCommand="UPDATE [Frettir] SET [Title]=@Title,[Description]=@Description,[CreatedBy]=@notandaID,[ArticleExt]=

Select statement ignoring parameters?

▼魔方 西西 提交于 2019-12-25 06:29:55
问题 When I use this code it returns every row in the table and i have no idea why. string SelectOleDb = "SELECT Top 1 * From `Employee Info` Where [Employee Name]=@EmployeeName" Order By ID DESC"; OleDbConnection OleDbCon = new OleDbConnection(EmployeeInfo.Properties.Settings.Default.cstrEmployeeInfoDatabase); OleDbDataAdapter OleDbAdpt = new OleDbDataAdapter(); OleDbCommand OleDbCom = new OleDbCommand(SelectOleDb, OleDbCon); OleDbCom.Parameters.AddWithValue("@EmployeeName", employee_NameComboBox

Unable to write data to excel using oledb

谁都会走 提交于 2019-12-25 02:38:15
问题 I want to write certain data to my excel file and for that purpose i am using OLEDB. I have a huge chunk of data which can count to maybe 50000 to 60000 records. Currently my code is as shown below: string connectionString = String.Format("Provider=Microsoft.ACE.OLEDB.12.0; Data Source ={0};Extended Properties ='Excel 12.0 Xml;HDR=YES;Mode=ReadWrite';", filePath); using (OleDbConnection cn = new OleDbConnection(connectionString)) { String statement = "UPDATE [Sheet1$] SET [Status] = @Status,

C# OLEDBConnection to Excel

我的未来我决定 提交于 2019-12-25 01:44:50
问题 I am copying an Excel sheet into a Datatable as such: OleDbCommand command = new OleDbCommand(); command = new OleDbCommand("Select * from [working sheet$]", oleDBConnection); OleDbDataAdapter dataAdapter = new OleDbDataAdapter(); dataAdapter.SelectCommand = command; dataAdapter.Fill(dt); Is there a similar method where I can just simply copy the datatable back to an Excel sheet? The examples I keep finding are copying cell by cell, but this can be noticably slow with large data sets. Thanks

Excel does not have updated values using oledb c#

无人久伴 提交于 2019-12-24 20:22:42
问题 I am new to C# and trying to write values to an excel file using OLEDB. The problem here is the first time if there is no excel file present in that location it works fine and prints the value to excel, but the second time if the excel is present it does not overwrite or write a new value to the excel. I also need to run this in a loop as I have four rows to print and not one. Need help with this. This is my code snippet and I know I it has code for only one row to print but I don't know the

Load data Oracle Table to C# combobox using Oledb

被刻印的时光 ゝ 提交于 2019-12-24 18:31:47
问题 hello i have create a table buy_unit in oracle database CREATE TABLE buy_unit( unit_id NUMBER(10) not null PRIMARY KEY, unit_name VARCHAR2(10) not null ); and insert Values INSERT INTO BUY_UNIT values(001,'Liter'); desc SELL_BUY_UNIT; then create a combo box combobox1 in C# now can load buy_unit table data in combobox ? i have use the connection: OleDbConnection con = new OleDbConnection("Provider=MSDAORA;Data Source=XE;User ID=user1;password=pssword"); 回答1: Well, you can see below code which

Multi-targeting .net core 2.2 with .net 4.6.1

懵懂的女人 提交于 2019-12-24 17:28:48
问题 I had started on an application on gathering data from meteorological stations for some time now and to make it cross platform I used .net core 2.2 mvc along with some libraries. Even though the data is saved in a mysql db, the client recently requested that selected meteo records from a list, to be saved in a local access db. To achieve that I had to use the legit database provider from microsoft which in this case is EntityFrameworkCore.Jet . I didn't know that there was a compatibility

Find connection string for connecting to MySQL Server 5.1.50 using OleDbConnection

两盒软妹~` 提交于 2019-12-24 02:34:14
问题 I am interested how can I find the connection string in order to be able to connect to MySQL Server 5.1.50 using OleDbConnection(C#). I used this auto generated string (after adding new data source in Visual Studio): server=localhost;User Id=MyID;password=MyPassword;database=MyDatabase but I always get the same error message: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'. I have tried different providers but neither of them seems to

Dynamic OLEDB Connections in SSIS

ⅰ亾dé卋堺 提交于 2019-12-24 00:56:10
问题 I am designing a SSIS package which imports data from one data base to other database. In reality I need to import data from multiple data source to one destination database . One way to do, that I know is to use package configuration for all data sources (connection strings) and run multiple instances of the same package. But I want something like, I should provide as many connection strings as I need at a point of time in my config file and my package should connect to each database reading

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

余生颓废 提交于 2019-12-24 00:53:04
问题 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> <b>Please Select Excel File: </b> <asp:FileUpload ID="fileuploadExcel" runat="server" />