How can i show data in datagrid?
Hi all
I would like to show data from two tables in Oracle9i like this commandstring
*********************************
Me.OracleSelectCommand1.CommandText = "SELECT P.PRD_PRODUCTID,P.PRD_PRODUCTTITLE," & _
"S.STY_STYLEID,S.STY_STYLENAME,P.PRD_UNITPRICE " & _
"FROM tblproduct as P,tblStyle as S " & _
"WHERE S.STY_STYLEID=P.PRD_STYLEID " & _
"ORDER BY " & viewstate("sortfield") & " " & viewstate("sortdirection")
Me.OracleSelectCommand1.Connection = Me.OracleConnection1
'
'OracleDataAdapter1
'
Me.OracleDataAdapter1.SelectCommand = Me.OracleSelectCommand1
'
'DataSetProduct1
'
Me.DataSetProduct1.DataSetName = "DataSetProduct"
End If
' - - - - - - - - - - - - - - - - - - - - - - - - - -
OracleDataAdapter1.Fill(DataSetProduct1)
DataGrid1.DataSource = DataSetProduct1
DataGrid1.DataBind()
*****************************************
But it shows error like this
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
*****************************************
All fields in two tables is not null and I set Sty_Styleid in tblstyle for Primary key and set Prd_styleid in tblproduct for foreign key
How should I solve this problem?
Thanks in advance
Acpman
|