الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

delete from gride

بدأه shaimaa fawzy في 25 أغسطس 2013 · 1 رد · 831 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله

اقوم بعمل web user control

لعمل بحث فى قاعدة البيانات المشكلة التى تواجهنى هى عند الحذف يظهر لى هذا الخطأ

post-260032-0-05566400-1377391826_thumb.

 

وهذا كو الحذف

 

 protected void btnremove_Click(object sender, EventArgs e)
        {

            m.Unsubscribe(grid.SelectedRow.Cells[1].Text);
            btnremove.Enabled = false;
            grid.DataBind();
            lblmessage.Text = "User Deleted Successfully" ;
        }
 

وهذا باقى الكود واللى فيه مشكلة

 //Run Connection
        private int Connection()
        {
         //DB work
            conn.Open();
            try
            {
            int x=comand.ExecuteNonQuery();
            conn.Close();
            return x;
            }
            catch(SqlException ex)
            {
                conn.Close();
                return ex.Number;
            }
        }

        //insert Or Update Or Delete Opration
        public int RunUpdate (string IUD)
        {
            //sent to me text operation i(nsert Or Update Or Delete Opration)
        Intialize(CommandType.Text,IUD);
            return Connection();
        
        }
        
        public DataTable RunQuery (string select)
        {
            //select opretion
            Intialize(CommandType.Text,select);
            tbl =new DataTable();
            conn.Open();
            tbl.Load(comand.ExecuteReader());
            conn.Close();
            return tbl ;
        }
        
        public int RunProcedure(string ProcedureName,SortedList ParaVal)
         {
           Intialize(CommandType.StoredProcedure,ProcedureName);

            //add paramater by for loop
            //get parameter name by paraval .getkey
            //get value by index
           for (int x = 0; x < ParaVal.Count; x++)
           {
               comand.Parameters.AddWithValue(ParaVal.GetKey(x).ToString(), ParaVal.GetByIndex(x).ToString());

           }
           return Connection();
         
           
            }

#2

المشكله عندك فى قراءة حقل DateTime
 

C# - SQl - Matlab - ASP - PHP - HTML -XML -Crystal Report

مواضيع مشابهة