oracle no primary key on table

Posts   
 
    
buckd32
User
Posts: 20
Joined: 09-Oct-2009
# Posted on: 09-Oct-2009 14:01:03   

our dba is quite strict and does not allow a pimary key on the table how do i get around this this is normally the code i use for a load but does not work since oracle table does not have any attached primary key

using System; using System.Collections; using System.Configuration; using System.Data;

using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts;

using Telerik.WebControls; using HCLCMS; using HCLCMS.dataservice;

using HCLCMS.DatabaseSpecific; using HCLCMS.EntityClasses; using HCLCMS.FactoryClasses; using HCLCMS.HelperClasses; using HCLCMS.RelationClasses; using System.Data.SqlClient; using SD.LLBLGen.Pro.ORMSupportClasses;

public partial class admin_modules_cms_cms : System.Web.UI.Page {

protected LLBLGenDataService _dataservice = new LLBLGenDataService();

protected void Page_Load(object sender, EventArgs e)
{

    Page.Title = "Page Administration";

    string[] imagepath = { "~/Images" };

    rebody.ImageManager.UploadPaths = imagepath;
    rebody.ImageManager.ViewPaths = imagepath;
    rebody.ImageManager.DeletePaths = imagepath;

    if (!IsPostBack)
    {



        int pageid = Convert.ToInt32(Request.QueryString["pageid"]);
        PagesEntity page = new PagesEntity(pageid);

// the above enntity code does not work however cause their is no primary key so what do i do for the oracle equlifiant

        if (pageid > 0)
        {
            _dataservice.FillEntity(page, null);
            txttile.Text = page.Title;
            txturl.Text = "";
            rebody.Content = page.Body;
            rdstartdate.SelectedDate = page.Datestarted;

            rdenddate.SelectedDate = page.Enddate;

            chkpublished.Checked = page.Published.Value;
             txturl.Text = page.Virtualname;

        }

    }
Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 09-Oct-2009 14:35:55   

I don't understand what kind of strictness is this, but who am I to judge a DBA.

You can work around this by using LLBLGen Pro Designer (Edit Entity), you can mark a field as a PK. (Check the "Is part of primary key" check box).

Save and re-generate the code.

buckd32
User
Posts: 20
Joined: 09-Oct-2009
# Posted on: 09-Oct-2009 15:58:39   

its set as a number so it is and the is a pimary key is grayed out what is the rules behind a pimary key being selectable

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Oct-2009 19:26:52   

The minimum requirement in that the field can not be nullable.

David Elizondo | LLBLGen Support Team