Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

 

I am getting the error:

 

An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

 

on the line

 

DataAdpt.Fill(DataSet1, "SP_PARCEL")

 

in the following code:

 

Dim stcon As String = "Provider=MSDAORA;Data Source=ORA920L;User Id=GVW90;Password=GVW90"

Conn = New OleDbConnection(stcon)

Conn.Open()

DataAdpt = New OleDbDataAdapter("Select * from SP_PARCEL where gid = 1302323", Conn)

CBuild = New OleDbCommandBuilder(DataAdpt)

DataSet1 = New DataSet("SP_PARCEL")

DataTable1 = New DataTable("SP_PARCEL")

DataAdpt.Fill(DataSet1, "SP_PARCEL")

 

This code works fine if i replace the * in the sqlquery with one or more column names.

 

Does anyone know why this might be? thanks

lorraine

Posted

Well, first, you create a table (DataTable1) but you don't add it to your DataSet, so I think it is not used (I think you don't need to create it since the Adapter will create it in the DataSet.

 

Second, are you sure the query works when you type it in SQL*Plus, or any other SQL client ?

 

And third, could you give us the messages that come with the OleDbException ?

 

Olivier.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...