Sep 1, 2025

Test

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
</style>
</head>
<body>
<table border="1" cellpadding="8" cellspacing="0" style="border-collapse:collapse;width:100%;"> <thead style="background:#f2f2f2;"> <tr> <th>Criteria</th> <th>Client-Side CSV Handling (Browser)</th> <th>Server-Side CSV Handling (.NET 8)</th> <th>Recommended Approach</th> </tr> </thead> <tbody> <tr> <td><b>Maximum Safe File Size</b></td> <td>≤ 100 MB (hard stop at 200 MB)</td> <td>≤ 500 MB normally<br>Up to 1 GB (exception only)</td> <td>Block client > 200 MB<br>Allow server streaming</td> </tr>
<tr>
  <td><b>2 GB CSV Feasibility</b></td>
  <td>❌ Not feasible<br>Browser crash guaranteed</td>
  <td>⚠️ Possible but risky<br>Background job required</td>
  <td>Avoid via browser<br>Use offline ingestion</td>
</tr>

<tr>
  <td><b>Memory Usage</b></td>
  <td>High (JS heap limited)</td>
  <td>Low (streaming row-by-row)</td>
  <td>Never load full CSV in memory</td>
</tr>

<tr>
  <td><b>Validation Strategy</b></td>
  <td>Headers + sample rows only</td>
  <td>Full validation per row</td>
  <td>Hybrid: client pre-check, server full check</td>
</tr>

<tr>
  <td><b>Performance Stability</b></td>
  <td>Low for large files<br>Tab freeze / crash</td>
  <td>High when streamed properly</td>
  <td>Server streaming preferred</td>
</tr>

<tr>
  <td><b>Error Recovery</b></td>
  <td>Poor (reload loses progress)</td>
  <td>Good (retry, resume possible)</td>
  <td>Server-side logging & retry</td>
</tr>

<tr>
  <td><b>User Experience</b></td>
  <td>Good for small files</td>
  <td>Better for large files</td>
  <td>Warn user for large uploads</td>
</tr>

<tr>
  <td><b>Network Reliability</b></td>
  <td>Weak for long uploads</td>
  <td>Better control & timeout handling</td>
  <td>Chunked / streamed upload</td>
</tr>

<tr>
  <td><b>Implementation Complexity</b></td>
  <td>High for large files</td>
  <td>Moderate but controlled</td>
  <td>Keep client logic minimal</td>
</tr>

<tr>
  <td><b>Security & Abuse Risk</b></td>
  <td>High (large payloads)</td>
  <td>Lower (limits & throttling)</td>
  <td>Server-side enforcement</td>
</tr>

<tr>
  <td><b>Recommended Usage</b></td>
  <td>Small CSVs, quick checks</td>
  <td>Medium & large CSVs</td>
  <td>Use size-based routing</td>
</tr>

</table>
</body>
</html>

Apr 10, 2016

Databound fields in GridView using Ado.net in asp.net C#

Hello there, here i m explaining how to use Databound fields using gridview .
Now first of all we will create a database.  Here the following script, copy it and run it.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tbEmp]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tbEmp](
      [id] [int] IDENTITY(1,1) NOT NULL,
      [name] [varchar](50) NULL,
      [age] [int] NULL,
      [address] [varchar](50) NULL
) ON [PRIMARY]
END



Place the GridView control on a form and set the following property.
       AutoGenerateColumns="False"
And set the Gridview Events name is
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"
onrowupdating="GridView1_RowUpdating"



Or add the default.aspx page and paste the following source code in it.


DataList Paging using ado.net in asp.net C#

In this article i am explaining how to do paging in datalist as we know datalist control does not support paging properties as Gridview control support. In this article i m displaying two images for paging and according to your requirement you can change it.  First of all create a database following the script which you can copy and paste it in your sql server 2005.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tbStudent]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tbStudent](
      [id] [int] IDENTITY(10,1) NOT NULL,
      [name] [varchar](50) NULL,
      [age] [int] NULL,
      [rollno] [int] NULL,
      [address] [varchar](50) NULL,
      [image] [varchar](50) NULL
) ON [PRIMARY]
END






Oct 8, 2010

How to create Temporary Table in asp.net with compute column in C#




using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default3 : System.Web.UI.Page
{
    Int32 tt;  // tt for total it will calculate the total
    DataTable tb = new DataTable(); //create a instance tb of Datatable

    protected void Page_Load(object sender, EventArgs e)
    {
// here we will create a temporary table of columns under ispostback.
        if (IsPostBack == false)
        {
//”ord” is a datatable type which create a “Table” and “c” for datatable columns.
            DataTable ord = new DataTable("Table"); //the “Table” value must be same for
            DataColumn c = new DataColumn();        // always
            ord.Columns.Add(new DataColumn("value", Type.GetType("System.Int32")));
// “value” is a column name with Int32 datatype.
            ord.Columns.Add(new DataColumn("length", Type.GetType("System.Int32")));
// “length” is a column name with Int32 datatype.
            ord.Columns.Add(new DataColumn("breadth", Type.GetType("System.Int32")));
// “total” is a column name with Int32 datatype.
            ord.Columns.Add(new DataColumn("total", Type.GetType("System.Decimal")));
// “total” is a Expression which calculate the following formula
            ord.Columns["total"].Expression = "value/(length*breadth)";
//storing the structure in “ss” name session.
            Session["ss"] = ord;
           
        }      
    }
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        grdview();// will call the grdview method
    }

// following the temporary table with structure
    private void tempdata()
    {
        tb = (DataTable)(Session["ss"]); //getting the structure from session and
        GridView1.DataSource = tb; // storing in “tb” datatable variable and bind with
        GridView1.DataBind(); // gridview
        Int32 a; Int32 i; ;
        a = tb.Rows.Count; // it will count the total records in the temporary table
    

        for (i = 0; i < a; i++)
        {
            tt += Convert.ToInt32(tb.Rows[i][3]);// will sum the each value
        }
        Label1.Text = tt.ToString();// display in label the total values

    }