public static clsDataSetFunction DAGetDataSet(SqlTransaction Tran, SqlConnection conn, params object[] Param)
        {
            SqlDataAdapter     DataAdaptor   = null;
            string             strGivenQuery = Param[0].ToString();
            clsDataSetFunction RetVal        = new clsDataSetFunction();

            System.DateTime StartAccess = DateTime.MinValue;
            int             Count       = 0;

            for (Count = 1; Count <= Param.GetUpperBound(0); Count++)
            {
                if (Param[Count].ToString() == "'")
                {
                    Param[Count] = "";
                }
                strGivenQuery = strGivenQuery.Replace("%%Param" + System.Convert.ToString(Count) + "%%", System.Convert.ToString(Param[Count]));
            }
            try
            {
                SqlCommand cmd = new SqlCommand(strGivenQuery, conn);
                cmd.Transaction = Tran;
                DataAdaptor     = new SqlDataAdapter(cmd);
                DataAdaptor.Fill(RetVal);
            }
            catch (Exception)
            {
                RetVal = new clsDataSetFunction();
                RetVal = null;
            }

            return(RetVal);
        }
        /*--(7):-This function is work as Check Duplicate value*/
        public static bool DAIsDuplicate(string strTableName, string strFieldName, string strCheckFild, string strParameterValue)
        {
            clsDataSetFunction ExDS = null;

            try
            {
                ExDS = DAGetDataSet(QCheckDuplicate, strFieldName, strTableName, strCheckFild, strParameterValue);
            }
            catch (Exception Ex)
            {
                //MessageBox.Show(Ex.Message, Program.Title);
            }
            return(ExDS.RowsCount() > 0);
        }
        public static int DAGetNextID(string TableName, string Field, string parmField)
        {
            clsDataSetFunction ExDS = null;

            try
            {
                ExDS = DAGetDataSet(QGetNextIDChasis, Field, TableName, parmField);
            }
            catch (Exception Ex)
            {
                //MessageBox.Show(Ex.Message, Program.Title);
            }
            return(ExDS.NullAsInteger(0, "MaxID"));
        }
        /*--(1):-This Function is work as Get Data From dataBase And Return Dataset*/
        public static clsDataSetFunction DAGetDataSet(params object[] Param)
        {
            SqlDataAdapter     DataAdaptor   = null;
            string             strGivenQuery = Param[0].ToString();
            clsDataSetFunction RetVal        = new clsDataSetFunction();

            System.DateTime StartAccess = DateTime.MinValue;
            int             Count       = 0;

            for (Count = 1; Count <= Param.GetUpperBound(0); Count++)
            {
                if (Param[Count].ToString() == "'")
                {
                    Param[Count] = "";
                }
                strGivenQuery = strGivenQuery.Replace("%%Param" + System.Convert.ToString(Count) + "%%", System.Convert.ToString(Param[Count]));
            }
            try
            {
                if (CheckConnection() == false)
                {
                    RetVal = new clsDataSetFunction();
                    RetVal = null;
                }

                DataAdaptor = new SqlDataAdapter(strGivenQuery, Program.DataConn);
                //  DataAdaptor = new SqlDataAdapter(strGivenQuery, ApplicationFunction.ConnectionString());
                DataAdaptor.Fill(RetVal);
            }
            catch (Exception)
            {
                RetVal = new clsDataSetFunction();
                RetVal = null;
            }
            Program.DataConn.Close();
            return(RetVal);
        }