System.Data.OleDb.OleDbException: The DataType do not match in the criteria expression.


I have a little code that get the data from a db the select code line works in VS2005 i can make a debug and it return the number 1, so thats ok, but after the select line
DBAdapter3.Fill(DBDataSet3, "KennelEnggaardText") I get this error:
System.Data.OleDb.OleDbException: The DataType do not match in the criteria expression.

I want to take the record ID 1's text and place it in a FormView code.

Can someone plz. help me.

My code is:

1        Private Sub OpenDB3()
2            ' Connection yil en database samt SQL Select forspørgsel
3            DBConnection3 = New OleDbConnection(ConfigurationManager.ConnectionStrings("ConnectionStringDogs").ConnectionString)
4            SQLString3 = "SELECT * FROM KennelEnggaardText WHERE MainTextID ='" & Session("pageid") & "'"
5            DBAdapter3 = New OleDbDataAdapter(SQLString3, DBConnection3)
6            DBDataSet3 = New DataSet()
7            DBAdapter3.Fill(DBDataSet3, "KennelEnggaardText")
8            ' Udskriv data til en FormView med id=FormViewMainText
9            DBDataView3 = New DataView(DBDataSet3.Tables("KennelEnggaardText"))
10           FormViewMainText.DataSource = DBDataView3
11           FormViewMainText.DataBind()
12       End Sub

2/21/2007 6:38:45 PM 16182 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 9

got it, it was line 4 there was 2 ' tags that have to be removed and then it works.
2/21/2007 10:00:48 PM

Similar Artilces:

System.Data.OleDb.OleDbException: Data type mismatch in criteria expression.
Hi Forum, I have a login script working using text as password, i want to change this to a number, format (000) 000-000, when i submit 025987654 which is formated (025) 987-654 in a field im receiving; Data type mismatch in criteria expression. Any help out there!!! Thanks Paul if the password is truly a number, then you need to drop the quotes from around it when you build the sql statement i.e. select * from tblUser WHERE Password=025987654 and NOT select * from tblUser WHERE Password='025987654' Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? T...

System.Data.OleDb.OleDbException: Data type mismatch in criteria expression. #2
I am having trouble using OleDb within an ASP.NET application (C#) to write to a Yes/No data field in Access. I have a checkbox on my ASP.NET page and want this to save to a Yes/No field in an Access database. No matter what I try I get a "data type mismatch" message. I've tried the following variations to no avail:1.cmd.Parameters.Add("@SubsidyDoc", this.cbLeaseSubsidy.Checked);2.if (this.cbLeaseSubsidy.Checked == true)      cmd.Parameters.Add("@SubsidyDoc","-1"); else     cmd.Parameters.Add("@SubsidyDo...

System.Data.OleDb.OleDbException: Data type mismatch in criteria expression. HELP ME :)
Hellothis is my select code1 Dim ConnString1 As String = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=|DataDirectory|Nwind2003(Good).mdb" 2 Dim sqlstring3 As String = "SELECT * FROM customers WHERE CustomerID= '" & CustomerID & "'" 3 Dim conn2 As New OleDbConnection(ConnString1)4 Dim cmd2 As New OleDbCommand(sqlstring3, conn2)5 cmd2.CommandType = CommandType.Text6 Response.Write(sqlstring3)7 8 conn2.Open()9 Dim reader As OleDbDataReader = cmd2.ExecuteRe...

System.Data.OleDb.OleDbException was unhandled by user code
Master/Detail Editing - DetailsView I have created a master/detail setup where a GridView displays an complete index to all records in the my database. This in turn links to a DetailsView which gives editing access (New, Update and Delete) to the aforementioned individual records. The first to parts of my application work fine I can add to the access database and update to the access database. However when I attempt to delete from the database i am met with the error 'System.Data.OleDb.OleDbException was unhandled by user code - Data type mismatch in criteria ...

error:An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in
************* Edited by moderator Adec *************** Inserted missing < code></ code> tags. Always include such tags when including code in your postings. Don't force the moderators to do this for you. Many readers disregard postings without the code tags. ************************************************** the error "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in " occured in the line the code is below: CONM.ConnectionString = "Provider=""MSDAORA.1"";User ...

System.Data.OleDb.OleDbException: Undefined function 'Nz' in expression
Is there a work around (or another function that I could use) to the 'Nz' function? dunno. what's NZ do? (he says, searching around for his VB reference) edit : can't find NZ in my access ref / VB RefRTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unreadableJason Brown - MVP, IIS Converts to a number, making a null a 0. I believe you could do this with an Immediate If (IIF) though I do not do much ASP.NET work with Access.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog ah! I see. yeah, an IIf would do it I reckon ...

System.Data.OleDb.OleDbException: Invalid object name 'donations'.
I've tried everything I can think of to fix this. I know the database and table both exist and are referenced correctly, yet ASP.NET and SQL Query Analyzer tell me that the 'donations' object is invalid.You can see the full error at: {link removed}Just hit Continue without entering anything and you'll see the error.Thanks for you help. Are you sure donations exists? It's not dbo.donations or pete.donations or some other qualified name? Depending on how you created it, you may have to reference it with the owner name. Look in Enterprise Manager to see what the full name is. Don Don K...

System.Data.OleDb.OleDbException: You do not have the necessary permissions to use the "database.mbd" object
I have been reading all kinds of information on how to fix this issue but nothing has worked.  I have an Access database sitting on one server and my application is sitting on another.  When I run my application on my desktop it works fine but when I move it over to the server I get the following error: You do not have the necessary permissions to use the 'database.mdb' object.  Have your system administrator or the person who created this object establish the appropriate permissions for you. [OleDbException (0x80004005): You do not have the necessary permissions to use the ...

In my application  there is an upload process, where an excel file will be uploaded and data from the file will be displayed back on the page. It works fine the first time I access it. But if I hit the back button and do the same process again, I get the following error. System.Data.OleDb.OleDbException: Syntax error in FROM clause. oCmd.Fill(oDS); There are three excel sheets to choose from - sheet1,sheet2 and sheet3. When I debugged it, the files are loaded in a temporary file in c:\inetpub\app\tempfiles.  Here is the code for the above line.public DataTable SelectD...

 When I try to run my code, I keep getting two errors: System.Data.OleDb.OleDbException: Object invalid or no longer setORSystem.Data.OleDb.OleDbException: Cannot open any more tables These both happen if I refresh the page without changing any code. I'm working with MS Access, 2.0 C#. I'm opening two connections and making sure I've closed them. I only have 3 SQL queries which access two tables!  Thanks in advance. Show us the code. You should be using a try/finally or a using construct to guarantee the connections are being closed. Are you? ...

Hi, I have developed this page in asp, and keep getting this error once I click my submit button, the error that appears is: System.Data.OleDb.OleDbException: Could not find installable ISAM. The database is in access and contains a coach table with cid as the priamry key, username, password and team rows. Here is my source code <%@ Page Language="VB" %> <%@ import Namespace="" %> <%@ import Namespace="" %> <script runat="server"> Sub button_click(sender As Object, e...

Hi, I got the error A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll The thread 0x3a24 has exited with code 0 (0x0).   Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Unrecognized database format 'C:\inetpub\wwwroot\ExcelData.xlsx'.The file exists at that location . i tried this solution. I tried to change permi...

I did a simple select statement from the database, it works on other webpages that I put on the same server. But when it comes to this page, it gives this error: Exception Details: System.Data.OleDb.OleDbException: Selected collating sequence not supported by the operating system. Source Error: Line 79: dataAdapter.SelectCommand = dbCommand Line 80: Dim dataSet As System.Data.DataSet = New System.Data.DataSet Line 81: dataAdapter.Fill(dataSet) Line 82: Line 83: Return dataSet Is this becasue the server does no...

Changing from System.Data.OleDb to System.Data.OracleClient
I was using OleDb from ASP.NET written in VB to connect to an Oracle DB successfully. I have the Oracle client 8.1.7. After reading about the improved performance of OracleClient, I changed the application to use OracleClient. I am able to connect to the DB but get the following error when executing my stored proc. The proc executes fine outside of the program. exMessage.ToString "System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'EDSSP_BILL_LOGIN' ORA-06550: line 1, column 7: PL/SQL: Statement ignored...

Web resources about - System.Data.OleDb.OleDbException: The DataType do not match in the criteria expression. -

Resources last updated: 12/18/2015 10:26:24 AM