oledb

get column names Jet OLE DB in vb.net

心不动则不痛 提交于 2019-12-02 00:43:29
I've written a function which reads csv files and parametrizes them accordingly, therefore i have a function gettypessql which queries sql table at first to get data types and therefore to adjust the columns which are later inserted in sql. So my problem is when I set HDR=Yes in Jet OLE DB I get only column names like F1, F2, F3. To circumvent this issue I've set HDR=No and written some for loops but now I get only empty strings, what is actually the problem? here is my code: Private Function GetCSVFile(ByVal file As String, ByVal min As Integer, ByVal max As Integer) As DataTable Dim ConStr

get autoNumber value from database

情到浓时终转凉″ 提交于 2019-12-02 00:10:56
The code is below. in my code I updating existing row(from existing table) that the program get all the updated values from textBoxes. there is at the end(the last column)of the table autoNumber field which is named as "codonsAutoNum" I don't know how to get the value (autonumber value) from the databese. I need the value in the position (in the code) where there is '??'. thank you all for your help! the code: private void update_Click(object sender, EventArgs e) { string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Projects_2012\\Project_Noam\\Access\\myProject.accdb"

How to change Crystal Reports connection string using OLE DB in vb.net?

◇◆丶佛笑我妖孽 提交于 2019-12-01 22:50:55
i have a "Connection.vb" where all my Connection string stored and used by the entire program. i'm new to Crystal Reports.. and i want to changes its connection string based on the connection string i made... im using MS SQL 2008.. SQL Server Native Client 10.0 OLE DB Provider.. and here is my connection string. "Provider=SQLNCLI10;Server=....\SQLEXPRESS;Database=Blah;Trusted_Connection=yes" i tried to google it.. but they are using different language, different database, and complex examples... thanks in advance.. I just spent some quality time figuring out this exact problem, in VB. I hope

How in .Net do I Import Values from a CSV in the format I want using OleDB?

佐手、 提交于 2019-12-01 21:55:44
I have a CSV file that has a column that contains strings that look like integers. That is they should be dealt with as strings, but since they are numbers they appear to be imported as integers (dropping off the leading zeroes). Example Data: 0000000000079 0000999000012 0001002000005 0004100000007 The problem I'm seeing is that the last example data point comes through as DBNull.Value. I'm assuming this is because OleDB is treating that column as an integer (the data points come through without their leading zeroes also) and that 0004100000007 is greater than the largest integer value. Is

Sql Parametrized syntax error with VFP OleDb

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 21:45:08
问题 I'm trying to make an SQL parametrized update command for a DBF File ( Visual Fox Pro ) I don't know why, but i have a "syntax error" on the "DbCommand.ExecuteNonQuery();". The exception error message is "Syntax Error.". I don't have any additionnal informations. string maRequete = "UPDATE " + strNomTable + " set " + "evetype = @evetype ," + "evedes = @evedes ," + "evecli = @evecli ," + "eveusermo = @eveusermo ," + "eveinterv = @eveinterv where eveNum = '" + strEvtNumeroString.ToString() + "'

Undefined function 'Replace' in expression

自闭症网瘾萝莉.ら 提交于 2019-12-01 20:20:32
I am having a VB.Net application. I connect it with a MS Access database. Now I have to execute a query. My query is : Update table1 set field1=replace(field1,'|','"') This query seems to work fine from the query analyzer of the Access database but when I do the same form the VB.Net code it throws me an error stating "Undefined function 'Replace' in expression" I am using OLEDB connection and command. I am using the "executenonquery" feature. Can any one help me? Unfortunately when you connect to an Access database from you VB.Net application you aren't using the Access query engine at all.

Efficient way to bulk insert into Dbase (.dbf) files

五迷三道 提交于 2019-12-01 18:59:49
Im currently using OleDBCommand.ExecuteNonQuery (repeatedly called) to insert as much as 350,000 rows into dbase files (*.dbf) at a time from a source DataTable. I'm reusing an OleDbCommand object and OleDbParameters to set the values to be inserted each time when the insert statement is called. Inserting 350,000 rows currently takes my program about 45 mins. Is there a more efficient way to do this? Does something similar to the Bulk Insert option used in SQL Server exist for Dbase (*.dbf) files? Fixed the problem by changing the OleDB driver from Jet to vfpoledb. This cut the total time from

Oledb Update command

我们两清 提交于 2019-12-01 18:48:31
I make a program that saves and update a data from the database, I can save and read data, I can also update but the problem is, I can't select the "ID" as the index, here is my sample code using "ID" as the index, cmd = new OleDbCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "UPDATE Records SET FirstName = @firstname, LastName = @lastname, Age = @age, Address = @address, Course = @course WHERE [ID] = @id"; cmd.Parameters.AddWithValue("@id", int.Parse(label7.Text)); cmd.Parameters.AddWithValue("@firstname", textBox1.Text); cmd.Parameters.AddWithValue("@lastname", textBox2

Can I register/install Search.CollatorDSO.1 manually

[亡魂溺海] 提交于 2019-12-01 18:27:59
I'm currently trying to search through some indexed files using the windows.search service. My problem is that windows search cannot be installed on the web server because its a 'web edition'. Error message received is: Search.CollatorDSO.1 provider is not registered on the local machine However the index that I'm searching is on another server which does have windows search installed and I'm querying it remotely. This was all working fine in development but only because I have windows.search installed on my dev box. My question is whether it's possible to get the provider to run on the web

How to count empty rows when reading from Excel

醉酒当歌 提交于 2019-12-01 18:18:41
I'm using OLEDB to connect and read through data from an Excel spreadsheet. I have IMEX="1" and everything works ok. My problem is the sheets I'm reading from may start with several empty rows and the number of empty rows is important. For example, if I was reading a 5x5 grid like: - - - - - - - - - - 2 - 3 3 8 - - - - - - - 5 2 2 where '-' represents an empty cell. The fact that the first two rows are empty is important. The size of the grid is dynamic. My code appears to be ignoring the first empty rows. But deals with the empty row at line 4 ok. How can I count the number of empty rows at