DataTable dt1 = new DataTable();
dt1.Columns.Add("SiteName", typeof(string));
dt1.Columns.Add("State", typeof(string));
dt1.Columns.Add("Cluster", typeof(string));
for (int i = 0; i < 10; i++)
{
dt1.Rows.Add("A", "B", "C");
}
gvData.DataSource = dt1;
gvData.DataBind();
Updated
using System.Data.SqlClient;
for (int n = 0; n < dt1.Rows.Count; n++)
{
try
{
SqlConnection con = new SqlConnection("Your Database Connection String");
string col1 = Convert.ToString(dt1.Rows[n]["SiteName"]);
string col2 = Convert.ToString(dt1.Rows[n]["State"]);
string col3 = Convert.ToString(dt1.Rows[n]["Cluster"]);
string strQry = "insert into table(col1,col2,col1) values('" + col1 + "','" + col2 + "','" + col3 + "')";
con.Open();
SqlCommand cmd = new SqlCommand(strQry, con);
cmd.ExecuteNonQuery();
}
catch(exception e1)
{
}
finally
{
con.Close();
}
}