Beispiel #1
0
        public Boolean Check_PrimaryKey(string AccessName)
        {
            sda = new SqlDataAdapter("select * from Tbl_Access where AccessName = '" + AccessName.Replace("ی", "ي") + "'", conn);

            try
            {
                dsaccess.Clear();

                if (conn.State == ConnectionState.Closed)
                {
                    conn.Open();
                }

                sda.Fill(dsaccess.Tbl_Access);
                if (dsaccess.Tbl_Access.Rows.Count == 0)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch
            {
                throw new Exception("خطا در ارتباط با بانک اطلاعاتی!");
            }
            finally
            {
                conn.Close();
            }
        }
Beispiel #2
0
 public OCA.Common.DataSets.BaseInformation.Access GetAccess()
 {
     try
     {
         dsaccess.Clear();
         dsaccess = accessclass.GetAccess();
         return(dsaccess);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }