M
_MC_
Hi,
I want to request if an Colum is Primary Key or Not via Ole (C# Code).
Following Part of Code descripes my ideas. However the function
returns always false, no matter what Database System (e. g. MS SQL,
Paradox, ...). This also appears if i request the Attribute
'AllowDBNull'. Now - how can I fix this?
Thanks for your help.
Stefan
Code:
public Boolean isPrimary (int checkPos)
{
OleDbDataAdapter myAdapter = new
OleDbDataAdapter(commandText, conn);
DataSet mySet = new DataSet();
myAdapter.Fill(mySet);
return mySet.Tables[0].Columns[checkPos].Unique;
}
I want to request if an Colum is Primary Key or Not via Ole (C# Code).
Following Part of Code descripes my ideas. However the function
returns always false, no matter what Database System (e. g. MS SQL,
Paradox, ...). This also appears if i request the Attribute
'AllowDBNull'. Now - how can I fix this?
Thanks for your help.
Stefan
Code:
public Boolean isPrimary (int checkPos)
{
OleDbDataAdapter myAdapter = new
OleDbDataAdapter(commandText, conn);
DataSet mySet = new DataSet();
myAdapter.Fill(mySet);
return mySet.Tables[0].Columns[checkPos].Unique;
}