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
Abhishek Jaiswal
95
19.8k
9.6m
Getting this error
Jul 8 2014 8:33 AM
hello!
my code for select operation is
protected void Button1_Click(object sender, EventArgs e)
{
string strcon = ConfigurationManager.ConnectionStrings["masterConnectionString"].ConnectionString;
// Creating SQL connection
SqlConnection con = new SqlConnection(strcon);
// Connection open
con.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM SignUp", con);
DataSet ds = new DataSet("SignUpDataSet");
SqlDataAdapter rdr = new SqlDataAdapter (cmd);
rdr.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
but am getting this error on button click event:
Both DataSource and DataSourceID are defined on 'GridView1'. Remove one definition.
rdr.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
please, help!
Reply
Answers (
1
)
How to perform update and insert operation
mvc webgrid actionlink popup