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
Pavan Bujji
NA
207
36.5k
i want to merge two tables in dataset.
Oct 24 2016 9:25 AM
im getting
the exception cannot find table 0.
My code is
con = new SqlConnection(strConString);
con.Open();
cmd = new SqlCommand("select * from Empdetails", con);
cmd.CommandType = CommandType.Text;
Da = new SqlDataAdapter(cmd);
Ds = new DataSet();
Da.Fill(Ds, "Empdetails");
cmd = new SqlCommand("select * from EmpTable", con);
cmd.CommandType = CommandType.Text;
Da = new SqlDataAdapter(cmd);
Ds = new DataSet();
Da.Fill(Ds, "EmpTable");
Grdtables.DataSource = Ds.Tables[0];
Grdtables.DataBind();
con.Close();
Ds.Tables[0].Merge(Ds.Tables[1]);
Dt = Ds.Tables[0];
for (i = 0; i <= Dt.Rows.Count - 1; i++)
{
Response.Write(Dt.Rows[i].ItemArray[0] + " -- " + Dt.Rows[i].ItemArray[1]);
}
}
Please give me the solution.
Regards,
Pavan.
Reply
Answers (
6
)
Round Of Value of Grand Total Price In Windows Baseppliction
Close() is function is not working in C#