TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ajith s
NA
9
8.2k
regarding gridview in asp.net
Dec 8 2012 8:25 AM
hi i got error in coding of grid view in asp.net
here is my coding
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;
using System.Data.Sql;
using System.Data;
namespace adapter
{
public partial class _Default : System.Web.UI.Page
{
public SqlConnection con = new SqlConnection();
public SqlCommand cmd = new SqlCommand();
public SqlDataAdapter sda = new SqlDataAdapter();
public SqlDataReader sdr;
public DataTable myDataTable = new DataTable();
public String constr, cmdstr;
protected void Page_Load(object sender, EventArgs e)
{
constr = @"Data Source=RAHUL-PC\SQLEXPRESS;Initial Catalog=a1;Integrated Security=True";
con = new SqlConnection(constr);
}
protected void Button1_Click(object sender, EventArgs e)
{
con.Open();
cmd=new SqlCommand("select * from details",con);
sda=new SqlDataAdapter(cmd);
sda.Fill(myDataTable);
GridView2.DataSource = myDataTable;
GridView2.DataBind();
con.Close();
}
}
}
Reply
Answers (
2
)
HOW WE CAN ADD TWO DATASET INTO ONE?
Opening pdf file when user clicks on Show button.