Solutionsforyou

  • Home
  • Business
    • Internet
    • Market
    • Stock
  • Parent Category
    • Child Category 1
      • Sub Child Category 1
      • Sub Child Category 2
      • Sub Child Category 3
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Featured
  • Health
    • Childcare
    • Doctors
  • Home
  • Database
    • MSSQL
    • Market
    • Stock
  • Downloads
    • Dvd
    • Games
    • Software
      • Office
  • Parent Category
    • Child Category 1
      • Sub Child Category 1
      • Sub Child Category 2
      • Sub Child Category 3
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Featured
  • Health
    • Childcare
    • Doctors
  • Uncategorized

Thursday, 15 September 2016

 Unknown     06:12     No comments   

    SqlCommand cmd;
    static string connString =     System.Web.Configuration.WebConfigurationManager.ConnectionStrings["conn"].ConnectionString;
    DbCommand dbcommand;
    SqlDatabase db = new SqlDatabase(connString);
    public static SqlConnection scon = new SqlConnection(connString);





 #region Connection function
    public void CreateConnection()
    {
        if (scon.State != ConnectionState.Open)
        {
            scon.Open();
        }
    }
    public void CloseConnection()
    {
        scon.Close();
    }
    #endregion





 #region Common Function
    public DataSet GetDataSet(string SQL)
    {
        DataSet dsInv = new DataSet();
        dbcommand = db.GetSqlStringCommand(SQL);
        dsInv = db.ExecuteDataSet(dbcommand);

        return dsInv;
    }
    public DataTable GetDataTable(string SQL)
    {
        DataTable dtInv = new DataTable();
        dbcommand = db.GetSqlStringCommand(SQL);
        ds = db.ExecuteDataSet(dbcommand);
        if (ds.Tables.Count > 0)
        {
            dtInv = ds.Tables[0];
        }
        return dtInv;
    }




 public int ExecuteQuery(string qur)
    {
        int Retval = 0;
        dbcommand = db.GetSqlStringCommand(qur);
        Retval = db.ExecuteNonQuery(dbcommand);
        return Retval;
    }
    public int ExecuteScalar(string qur)
    {
        int Retval = 0;
        dbcommand = db.GetSqlStringCommand(qur);
        Retval = Convert.ToInt32(db.ExecuteScalar(dbcommand));
        return Retval;
    }
    public int ExecuteIntScalar(string qur)
    {
        int Retval = 0;
        dbcommand = db.GetSqlStringCommand(qur);
        Retval = Convert.ToInt32(db.ExecuteScalar(dbcommand));
        return Retval;
    }
    public string ExecuteStringScalar(string qur)
    {
        string Retval = string.Empty;
        dbcommand = db.GetSqlStringCommand(qur);
        Retval = Convert.ToString(db.ExecuteScalar(dbcommand));
        return Retval;
    }



 <add name="conn" connectionString="Data Source=; Initial Catalog=;User ID=;Password=;MultipleActiveResultSets=True;Connect TimeOut=100000;Pooling=true;Max Pool Size=250;Min Pool Size=100;"/>
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Wednesday, 14 September 2016

Data table Class Table Shorting

 Unknown     05:59     No comments   

 protected void GridView1_PreRender(object sender, EventArgs e)
    {
        dtInv = objDataAccess.GetDataTable("select * from tbl_fin_Customerregistration");
        GridView1.DataSource = dtInv;  //GetData is your method that you will use to obtain the data you're populating the GridView with

        GridView1.DataBind();

        if (GridView1.Rows.Count > 0)
        {
            //Replace the <td> with <th> and adds the scope attribute
            GridView1.UseAccessibleHeader = true;

            //Adds the <thead> and <tbody> elements required for DataTables to work
            GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;

            //Adds the <tfoot> element required for DataTables to work
            GridView1.FooterRow.TableSection = TableRowSection.TableFooter;
        }

    }


                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="true" width="100%" CssClass="table table-striped table-bordered table-hover gvv" OnPreRender="GridView1_PreRender" >
                        </asp:GridView>





 <script language="javascript" type="text/jscript">
        $(document).ready(function () {
            $('#dataTables-example').DataTable({
                responsive: true,
                "lengthMenu": [[10, 25, 50, 100, 500, 1000, 1000000], [10, 25, 50, 100, 500, 1000, "All"]]
            });
        });
        $(document).ready(function () {
            $('.gvv').DataTable({
                responsive: true,
            "lengthMenu": [[10, 25, 50, 100, 500, 1000, 1000000], [10, 25, 50, 100, 500, 1000, "All"]]
            });
        });
    </script>
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Monday, 5 September 2016

List Spand

 Unknown     06:11     No comments   

<script>    
 $(function () {
          var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/") + 1);

          $("ul li a").each(function () {

              if ($(this).attr("href") == pgurl) {
                  //alert(pgurl);

                  $(this).parent().addClass("active");
                  //$(this).parent().find('li').addClass("active");
                  // $(this).addClass("active");
                  $(this).parent().parent().parent().addClass("active");
                  $(this).parent().parent().parent().parent().parent().addClass("active");
                  //alert($(this).parent().parent().parent().find('li').addClass("active");
              }
          })
      });

  
   </script>
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Popular Posts

  • (no title)
        SqlCommand cmd;     static string connString =     System.Web.Configuration.WebConfigurationManager.ConnectionStrings["conn"]...
  • List Spand
    <script>      $(function () {           var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/") + 1);...
  • Data table Class Table Shorting
     protected void GridView1_PreRender(object sender, EventArgs e)     {         dtInv = objDataAccess.GetDataTable("select * from tbl_fi...
  • Design
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd...
  • How we get table structure from database
    CREATE procedure dbo.Gettable    @tablename nvarchar(100)  as        DECLARE              @object_name SYSNAME  ,               @object_id ...
  • Dashboard
    https://startbootstrap.com/template-overviews/sb-admin-2/
  • hii
    hiii

Recent Posts

Categories

  • sql

Pages

  • Home

Blog Archive

  • ►  2017 (2)
    • ►  February (2)
  • ▼  2016 (5)
    • ▼  September (3)
      •     SqlCommand cmd;    static string connString =...
      • Data table Class Table Shorting
      • List Spand
    • ►  August (1)
    • ►  June (1)

About Me

Unknown
View my complete profile
Powered by Blogger.

Sample Text

Copyright © Solutionsforyou | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates