0
output will be displayed in tree formate.I don't want like that way, i want side by side in grid
0
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace Merge
{
public partial class _Default : System.Web.UI.Page
{
string strConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlDataAdapter sqlda1, sqlda2;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bindgrid();
}
}
public void bindgrid()
{
SqlConnection con = new SqlConnection(strConnString);
con.Open();
sqlda1 = new SqlDataAdapter("select * from table1", con);
sqlda2 = new SqlDataAdapter("select * from table2", con);
DataSet ds1 = new DataSet();
DataSet ds2 = new DataSet();
sqlda1.Fill(ds1, "table1");
sqlda2.Fill(ds2, "table1");
ds1.Merge(ds2, false, MissingSchemaAction.Add);
GridView1.DataSource = ds1;
GridView1.DataBind();
}
}
}
