Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2004, 08:31 PM
Authorized User
 
Join Date: Jan 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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






Similar Threads
Thread Thread Starter Forum Replies Last Post
The DataGrid does not show data sams ASP.NET 1.0 and 1.1 Professional 16 June 20th, 2007 07:19 AM
show date/time in a datagrid. mehmetned C# 2005 0 March 23rd, 2007 08:43 AM
show date/time in a datagrid. mehmetned ASP.NET 1.0 and 1.1 Basics 0 March 23rd, 2007 08:38 AM
datagrid can't show anything irisnun Beginning VB 6 1 March 14th, 2007 01:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.