How to return datatable using id in ASP Dot

  private DataTable Getdat(int ApplicationId)
        {
            DataTable returndtt = new DataTable();
            try
            {
                query = "Select OrgTypeIdPresent from Appmst Where ApplicationId=@ApplicationId";

                using (SqlCommand cmd = new SqlCommand(query, ObjCon))
                {
                    cmd.Parameters.AddWithValue("@ApplicationId", ApplicationId);
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(returndtt);
                }
            }
            catch (Exception ex)
            {
                lblApplDocError.Text = cnclss.SendExcepToDB(pageName, MethodBase.GetCurrentMethod().Name.ToString(), HttpContext.Current.Request.Url.ToString(), ex);
            }
            finally
            {

            }
            return returndtt;
        }

Comments

Popular posts from this blog

String Program in C#

CSV using XmlNode

Extension Method & Partial Class