Danasegarane Arunachalam replied to SYED ASGAR
Fetch the data using the below method
1.Create one data adapter
2.First fill the first table using Data adapter.Fill(table,1"Name for the table") Method
3.Then fill the second using Data adapter.Fill(table2,"Name for the table") Method
4.Merge the two table using Datatable.Merge method
5.Show in gridview
public void BindGridview()
{
con=new SqlConnection(“Connectionstring”);
da = new SqlDataAdapter(“Select * from Table1″, con);
da.Fill(ds1, “Record”);
da = new SqlDataAdapter(“select * from Table2″, con);
da.Fill(ds2, “Record”);
ds1.Merge(ds2);
Gridview1.DataSource = ds1;
Gridview1.DataBind();
}
}
Lalit M. replied to SYED ASGAR

Hi..
Try below code sample
ASPX code sample
---------------------
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkTitle" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Title" %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Description" %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblCommentBody" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"CommentBody" %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
CS Code sample
--------------------
using System;
using System.Collections;
using System.Configuration;
using System.Data;
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.Data.SqlClient;
public partial class Default_Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlConnection1 = new SqlConnection(connectionString);
SqlDataAdapter sqlAdapter1 = new SqlDataAdapter("SELECT TITLE, DESCRIPTON FROM TABLE1" , sqlConnection1);
SqlDataAdapter sqlAdapter2 = new SqlDataAdapter("SELECT COMMENTBODY FROM TABLE2" , sqlConnection1);
DataSet dataSet1 = new DataSet();
DataSet dataSet2 = new DataSet();
sqlAdapter1.Fill(dataSet1, "TABLE1");
sqlAdapter2.Fill(dataSet2, "TABLE2");
dataSet1.Merge(dataSet2, false, MissingSchemaAction.Add);
GridView1.DataSource = dataSet1;
GridView1.DataBind();
}
}
alot var Hi What are Master Pages in ASP.NET? or What is a Master Page? ASP.NET master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page. What are the 2 important parts of a master page? The following are the 2 important parts of a master page 1. The Master Page itself 2. One or more Content Pages Can Master Pages be nested? Yes, Master Pages
Page Directive? What is the purpose of page directive in aspx page? Directive Syntax Directives are instructions used to specify settings (related to how a page should render and processed) used by the page and user control compilers when they process ASP.NET Web Forms page (.aspx) and user control (.ascx) files. These are the essential part of every ASP.NET Page or Control. Directives can be located anywhere in an .aspx or .ascx file, but the values, same as any HTML tag) that are specific to that directive. Special Note: The @ Page directive can be used only in .aspx files, and the @ Control directive can be used
summary> / / / <param name = "command"> The SqlCommand to be prepared< / param> / / / <param name = "connection"> A valid SqlConnection, on which to execute this command< / param> / / / <param name = "transaction"> A valid SqlTransaction, or 'null was opened by the method, otherwose is false.< / param> private static void PrepareCommand(SqlCommand command, SqlConnection connection, SqlTransaction transaction, CommandType commandType, string commandText, SqlParameter[] commandParameters, out bool mustCloseConnection ) { if( command = = null ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders"); / / / < / remarks> / / / <param name = "connectionString"> A valid connection string for a SqlConnection< / param> / / / <param name = "commandType"> The CommandType (stored procedure, text, etc.)< / param> / / / <param name = "commandText"> The PublishOrders", new SqlParameter("@prodid", 24)); / / / < / remarks> / / / <param name = "connectionString"> A valid connection string for a SqlConnection< / param> / / / <param name = "commandType"> The CommandType (stored procedure, text, etc.)< / param> / / / <param name = "commandText"> The SqlParameter[] commandParameters) { if( connectionString = = null | | connectionString.Length = = 0 ) throw new ArgumentNullException( "connectionString" ); / / Create & open a SqlConnection, and dispose of it after we are done using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); / / Call the overload that takes a connection in place of the connection ExecuteNonQuery(connString, "PublishOrders", 24, 36); / / / < / remarks> / / / <param name = "connectionString"> A valid connection string for a SqlConnection< / param> / / / <param name = "spName"> The name of the stored prcedure< / param> / / / <param name = "parameterValues"> An
Remove(e.TabPage); } _cache.Add(e.TabPage); } } private void button1_Click(object sender, EventArgs e) { TabPage page = new TabPage("TabPage" + pageNumber.ToString()); AddControlsToTabPage(page); this.tabControl1.TabPages.Add(page); pageNumber++; this.tabControl1.SelectedTab = page; } private void AddControlsToTabPage(TabPage page) { page.Controls.Add(this.tab1CheckBox1); page.Controls.Add(this.tabCheckBox2 page.Controls.Add(this.tabCheckBox3); page.Controls.Add(this.tabCheckBox4); page.Controls.Add(this.tabCheckBox5); page