PC Review


Reply
Thread Tools Rate Thread

DataTable.PrimaryKeys returns nothing from Oracle

 
 
sanchisudhir@gmail.com
Guest
Posts: n/a
 
      17th Nov 2005
Hi,
I am not sure if this is the right place to post this. But here i go.

I am trying to fill a datatable from oracle with the primary key &
constraints info. But what ever i try the PrimaryKeys array is always
returned nothing. I have seen few post on similar problem but not one
has a solution i can find.

Here's my code. Plain & Simple.

**--------------------------------------------------------------------------**
cn.ConnectionString = "Provider=MSDAORA.1;Password=password;User
ID=userid;Data Source=Oracle02;Persist Security
Info=True;hostname=ipaddress;port=1521"
cn.Open()

Dim dAdapter As New OleDbDataAdapter
dAdapter.SelectCommand = New OleDbCommand("Select * From
myTable", cn)

'//create CommandBuilder
Dim cmdBuilder As New OleDbCommandBuilder(dAdapter)

'//create DataSet
Dim dSet As New DataSet

dAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
dAdapter.FillSchema(dSet, SchemaType.Source, "myTable")
dAdapter.Fill(dSet, "myTable")

MessageBox.Show("Column Count: " +
dSet.Tables("myTable").PrimaryKey.Length.ToString())

**--------------------------------------------------------------------------**

dSet.Tables("myTable").PrimaryKey is always returned nothing. The table
i am using has primary key & constraint.

Thanks in advance for ur help,
Sudhir

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in dataTable with Oracle Antônio José Formiga Neves Microsoft ASP .NET 1 23rd Dec 2007 04:03 AM
Error in dataTable with Oracle Antônio José Formiga Neves Microsoft C# .NET 1 22nd Dec 2007 05:38 PM
Re: NET Managed Provider for Oracle Always Returns Empty Datatable for queries with union Thomas H Microsoft ADO .NET 0 5th Aug 2004 04:33 PM
Re: NET Managed Provider for Oracle Always Returns Empty Datatable for queries with union Jonathan Allen Microsoft ADO .NET 0 4th Aug 2004 11:41 PM
Oracle returns trailing zero Scott Meier Microsoft ADO .NET 0 8th Oct 2003 11:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 PM.