RE: Multiple primary keys with ADOX under C#
From: jk (jk_at_discussions.microsoft.com)
Date: 03/22/05
- Next message: jk: "Multiple Primary Keys"
- Previous message: MJS: "Parameters in INSERT query problem"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Mar 2005 17:09:01 -0800
Hi Oliver,
Did the answer to your post help you out ?
This is regarding to creation of multiple columns in primary key
It workd out for me but when i try to execute select statement
from code, it says not a valid book mark !
if u have solutin to this pls let me know
"Oliver Japes" wrote:
> Hello,
>
> can anyone provide me a sample where a new table is created with multiple
> columns in the primary key using ADOX under C#?
>
> Currently, I'm using this line to add the primary keys:
> currentTable.Keys.Append("PrimaryKey", KeyTypeEnum.adKeyPrimary,
> currentColumn.Name, "", "");
>
> First thing is: all samples I can find say that the two empty strings at
> the end (for foreign key constraints) are optional, but I do only have one
> method, no overloads, so I have to call it this way.
>
> It works great for tables that only have one column in the primary key, but
> when I'm trying to add a second column, I'm getting a HRESULT: 0x80040E99,
> which I found out to be "The provider could not drop the object".
>
> Now I'm really confused on how to do that.
>
> I'm getting this ADOX-Exception all the time, no matter what I do, and all
> I can find are samples for Visual Basic. Is the whole world only coding VB
> now!?
>
> It would be great if someone could provide me one or more samples in C#.
>
> Thanks in advance,
>
>
> Oliver
>
- Next message: jk: "Multiple Primary Keys"
- Previous message: MJS: "Parameters in INSERT query problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|