Ask a Question related to ASP.NET General, Design and Development.
-
Rajesh Tiwari #1
Can Not Access Foreign Key Constraint
Hi Group,
i have a foreign key in a table in sql server.i am using a dataset and
populating it with the contents of this table.my problem is that i am not
able to access the foreign key that i cretaed on this table in the
database.i am using a code something like this.if i check the number of
constraints on the table it prints 1,which is nothing but the primary key
constraint on this table,why doesn't it print 2 and show both primary and
foreign key constraint.i have tried most of the combinations in the code
below.
plz help.
DataSet myDataSet = new DataSet("myDataSet");
myDataSet.EnforceConstraints=true;
SqlDataAdapter adpt=new SqlDataAdapter("select * from "+TableName,con);
//adpt.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adpt.FillSchema(myDataSet,SchemaType.Mapped);
Response.Write(myDataSet.Relations.Count);
Response.Write(myDataSet.Tables["Table"].Constraints.Count);
//Response.Write(myDataSet.Tables["dtbl"].Constraints[0].ConstraintName);
//Response.Write(myDataSet.Tables["dtbl"].Constraints[0].GetType());
thanks in advance
--
Rajesh Tiwari
Rajesh Tiwari Guest
-
Inconsistent error with create table statement containing foreign key constraint
Here is the clause defining a foreign key constraint. CONSTRAINT `contact_id_fk` FOREIGN KEY (`contact_id`) REFERENCES `conts` (`contact_id`) ... -
Microsoft Access & Foreign Languages
I am writing an sites for mulitple languages, even though in the script I tell the encoding type to be for the language in Microsoft Access it... -
Reading Foreign Keys From an Access Table with ADO
I try to analyse and synchronize two databases with an asp script. my problem is: i have to get all columns from a table, which are foreign keys... -
Help Please :- Group Constraint
There's a group drag behavior in the library that comes with Director. -- Craig Wollman Word of Mouth Productions phone 212 724 8302 fax ... -
Best way to create this constraint?
I need to enforce a simple validation rule on my table. The solution I came up works, but seems complex. Im hopping there is a better way to do this...



Reply With Quote

