Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

asp.net code generator

JAVAMAN2Oct 9 2011 — edited Oct 9 2011
hi friends
i develop my application with asp.net(c#,vs2010) and oracle(10g,toad), i write all sql in procedure and function and all of them under packages. after write plsql packages, i wite asp.net data acces layer which have only code like this;
      public int FaaliyetSil(FaaliyetSt faaliyet)
        {
            cmd = CreateCommand();
            cmd.CommandText = "PCK_YBS.P_FAALIYET_SIL";
            CmdLogParameterAdd(ref cmd);  
            cmd.Parameters.Add("FAALIYET_ID", OracleType.Number).Value = NullKontrol(faaliyet.FaaliyetId);
            return ExecuteNonQuery(cmd);
        }

        public DataTable FaaliyetListele(FaaliyetSt faaliyet, DateTime bitTarih, int kisiUygId,
            int index, int sayfaBuyukluk, out int toplamKayit)
        {
            cmd = CreateCommand();
            cmd.CommandText = "PCK_YBS.P_FAALIYET_LISTELE";
            CmdLogParameterAdd(ref cmd);
            cmd.Parameters.Add("RC_CURSOR", OracleType.Cursor).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("KISI_UYGULAMA_ID", OracleType.Number).Value = NullKontrol(kisiUygId);
            cmd.Parameters.Add("FAALIYET_ID", OracleType.Number).Value = NullKontrol(faaliyet.FaaliyetId);
            cmd.Parameters.Add("BIRIM_ID", OracleType.Number).Value = NullKontrol(faaliyet.BirimId);
            cmd.Parameters.Add("BAS_TARIH", OracleType.DateTime).Value = NullKontrol(faaliyet.Tarih);
            cmd.Parameters.Add("BIT_TARIH", OracleType.DateTime).Value = NullKontrol(bitTarih);
            CmdSayfalamaParameterAdd(ref cmd, index, sayfaBuyukluk);

            DataTable dt = ExecuteDataTable(cmd);
            toplamKayit = Convert.ToInt32(cmd.Parameters["TOPLAM_KAYIT"].Value) ;
            toplamKayit = toplamKayit == 0 ? dt.Rows.Count : toplamKayit;
            return dt;
        }
firs question: is there anything which writes automaticly this asp.net data access layer?
second question: because of using datatable i have use table columns names when fill my dropdownlist and gridview, and so i cannt seperate my view and dataacces from eachother. can you advise for this questions.
thank you very much

Edited by: JAVAMAN2 on Oct 9, 2011 1:26 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2011
Added on Oct 9 2011
0 comments
222 views