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
Aniket Narvankar
559
2.1k
608.2k
Dot Net
Oct 28 2015 5:30 AM
I have a DataTable
Name
A
B
C
D
E
F
G
column name is Name
Normally if we display output would be
A
B
C
D
E
F
G
I want the out put to be
A B
C D
E F
G
That is two row values on single row.
I have tried this
Response.Write("<htmL>");
Response.Write("<head>");
Response.Write("</head>");
Response.Write("<title>");
Response.Write("</title>");
Response.Write("<body>");
Response.Write("<table>")
for(int i = 0;i<dt.Rows.Count;i=i+2)
{
Response.Write("<tr>");
Response.Write("<td>");
Response.Write(dt.Rows[i]["Name"].ToString());
Response.Write(dt.Rows[i + 1]["Name"].ToString());
Response.Write("</tD>");
Response.Write("</tr>");
}
Response.Write("</table>");
Response.Write("</body>");
Response.Write("</html>");
It works fine for even values but odd value of datatable.row.count it creates problems,I am stuck on this.please do let me know about this how to do this
Thanks
Regards,
Aniket Narvankar
Reply
Answers (
1
)
Viewstate
Billing software