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
gully fretilop
NA
3
1.2k
Getting Specific Data in DataSet Column and export in excel
Feb 4 2015 9:48 PM
i have 5 column in my dataset.
name, age,sex, address and contact number
then i have 3 datarows in dataset
i need only name, address and contact number during export in excel..
how can i do that?
im using the using Excel = Microsoft.Office.Interop.Excel;
i only get the 1st row.. not all rows in data set
this is my code for getting the values
Microsoft.Office.Interop.Excel.Application ExcelAp = new Microsoft.Office.Interop.Excel.Application();
ExcelAp.Application.Workbooks.Add(Type.Missing);
ExcelAp.Columns.ColumnWidth = 25;
int i =0;
foreach( DataRow datarow in DsNow.Tables[0].Rows)
{
for(i = 0; DsNow.Tables[0].Rows.Count - 1; i ++)
{
ExcelAp.Cells[i + 6, 1] = datarow["name"].ToString();
ExcelAp.Cells[i + 6, 2] = datarow["address"].ToString();
ExcelAp.Cells[i + 6, 3] = datarow["contactnumber"].ToString();
}
}
please help
Reply
Answers (
1
)
how to create setup file with database .mdf file(vs2010)
convert my project into dll file