Click here to Skip to main content
15,065,644 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Menu items direction Pin
TheEagle27-Jul-08 21:44
MemberTheEagle27-Jul-08 21:44 
QuestionSession Time Out Pin
Jaydev Jangid27-Jul-08 20:26
MemberJaydev Jangid27-Jul-08 20:26 
AnswerRe: Session Time Out Pin
eyeseetee27-Jul-08 21:54
Membereyeseetee27-Jul-08 21:54 
AnswerRe: Session Time Out Pin
Reelix27-Jul-08 23:48
MemberReelix27-Jul-08 23:48 
QuestionTreeview from two datasources Pin
TheEagle27-Jul-08 20:20
MemberTheEagle27-Jul-08 20:20 
Question2-Tier application using ASP.Net 2.0 Pin
Samiullah27-Jul-08 19:28
MemberSamiullah27-Jul-08 19:28 
AnswerRe: 2-Tier application using ASP.Net 2.0 Pin
Paul Conrad27-Jul-08 19:43
professionalPaul Conrad27-Jul-08 19:43 
QuestionFor Loop Suggestion Plz Pin
Member 387988127-Jul-08 18:58
MemberMember 387988127-Jul-08 18:58 
Hi Guyz Good Morning,

I want to know the following for loop is corrcet or not,

Everything going on well in that for loop...,

But i feel for each data table the loop is going on more than once...,

Its possible to do any modification in that...,

Plz give me ur suggestion abt this:

for (int i = 0; i < DS.Tables.Count - 1; i++)
{
System.Web.UI.WebControls.DataGrid grid = new System.Web.UI.WebControls.DataGrid();
grid.HeaderStyle.Font.Bold = true;

foreach (DataRow dr1 in DS.Tables[i].Rows)
{
foreach (DataRow dr2 in DS.Tables[i + 1].Rows)
{
if (dr1["MID"].ToString() == dr2["MID"].ToString())
{
if (!Directory.Exists(_path + "\\" + dr1["EID"].ToString() + @"\"))
{
Directory.CreateDirectory(_path + "\\" + dr1["EID"].ToString() + @"\");
string _XLSPATH = _path + "\\" + dr1["EID"].ToString() + "\\" + dr1["Name Of Employee"].ToString() + ".xls";

using (StreamWriter sw = new StreamWriter(_XLSPATH))
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
grid.DataSource = DS.Tables[i];
grid.DataBind();
grid.RenderControl(hw);
}
}
}
else
{
string _XLSPATH = _path + "\\" + dr2["EID"].ToString() + "\\" + dr2["Name Of Employee"].ToString() + ".xls";
using (StreamWriter sw = new StreamWriter(_XLSPATH))
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
grid.DataSource = DS.Tables[i + 1];
grid.DataBind();
grid.RenderControl(hw);
}
}
}
}
else
{
if (!Directory.Exists(_path + "\\" + dr2["EID"].ToString() + @"\"))
{
Directory.CreateDirectory(_path + "\\" + dr2["EID"].ToString() + @"\");

string _XLSPATH = _path + "\\" + dr2["EID"].ToString() + "\\" + dr2["Name Of Employee"].ToString() + ".xls";

using (StreamWriter sw = new StreamWriter(_XLSPATH))
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
grid.DataSource = DS.Tables[i + 1];
grid.DataBind();
grid.RenderControl(hw);
}
}
}
else
{
string _XLSPATH = _path + "\\" + dr1["EID"].ToString() + "\\" + dr1["Name Of Employee"].ToString() + ".xls";

using (StreamWriter sw = new StreamWriter(_XLSPATH))
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
grid.DataSource = DS.Tables[i];
grid.DataBind();
grid.RenderControl(hw);
}
}
}
}
}
}
}

Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
QuestionHow to color some cells of table Pin
Rameez Raja27-Jul-08 18:41
MemberRameez Raja27-Jul-08 18:41 
AnswerRe: How to color some cells of table Pin
Venkatesh Mookkan27-Jul-08 18:49
MemberVenkatesh Mookkan27-Jul-08 18:49 
GeneralRe: How to color some cells of table Pin
Rameez Raja27-Jul-08 18:56
MemberRameez Raja27-Jul-08 18:56 
GeneralRe: How to color some cells of table Pin
Venkatesh Mookkan27-Jul-08 19:10
MemberVenkatesh Mookkan27-Jul-08 19:10 
QuestionIIS 7 with ASP Pin
Socheat.Net27-Jul-08 16:19
MemberSocheat.Net27-Jul-08 16:19 
AnswerRe: IIS 7 with ASP Pin
Venkatesh Mookkan27-Jul-08 16:29
MemberVenkatesh Mookkan27-Jul-08 16:29 
GeneralRe: IIS 7 with ASP Pin
Socheat.Net27-Jul-08 16:39
MemberSocheat.Net27-Jul-08 16:39 
GeneralRe: IIS 7 with ASP Pin
Venkatesh Mookkan27-Jul-08 16:43
MemberVenkatesh Mookkan27-Jul-08 16:43 
GeneralRe: IIS 7 with ASP Pin
Socheat.Net27-Jul-08 16:50
MemberSocheat.Net27-Jul-08 16:50 
GeneralRe: IIS 7 with ASP Pin
Venkatesh Mookkan27-Jul-08 17:18
MemberVenkatesh Mookkan27-Jul-08 17:18 
QuestionHow can I create this url "www.mysite.com/forum"? Pin
Nada Adel27-Jul-08 8:51
MemberNada Adel27-Jul-08 8:51 
AnswerRe: How can I create this url "www.mysite.com/forum"? Pin
Christian Graus27-Jul-08 10:18
protectorChristian Graus27-Jul-08 10:18 
QuestionTrying to host two asp.net web applications, but failed to host one of them? Pin
Nada Adel27-Jul-08 8:37
MemberNada Adel27-Jul-08 8:37 
AnswerRe: Trying to host two asp.net web applications, but failed to host one of them? Pin
Christian Graus27-Jul-08 10:19
protectorChristian Graus27-Jul-08 10:19 
QuestionCalling two methods in a button click action! Pin
WebMaster27-Jul-08 8:31
MemberWebMaster27-Jul-08 8:31 
AnswerRe: Calling two methods in a button click action! Pin
Christian Graus27-Jul-08 10:20
protectorChristian Graus27-Jul-08 10:20 
QuestionWinForm to WebForm Pin
ginzb7e827-Jul-08 4:39
Memberginzb7e827-Jul-08 4:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.