16,021,041 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by dA.d (Top 34 by date)
dA.d
20-Mar-13 1:13am
View
thanks for replay....
above part i used in my stored procedure but showing error can u show me how can i put the values in above query
dA.d
20-Feb-13 2:23am
View
yes..code of two button which i used as below:
protected void btnUpload_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
int Flag = 0;
string FileName = createNameForFile(btn.CommandArgument);//Returns Created File Name For the Question.
Session["QuestionId"] = btn.CommandArgument;
for (int i = 0; i < dtlViewDetails.Controls.Count; i++)
{
DataList DataList2 = (DataList)dtlViewDetails.Controls[i].FindControl("DataList2");
for (int j = 0; j < DataList2.Controls.Count; j++)
{
Label QuestionId = (Label)DataList2.Controls[j].FindControl("lblQuestionId");
Label lblHiddenFileName = (Label)DataList2.Controls[j].FindControl("lblHiddenFileName");
FileUpload Uploader = (FileUpload)DataList2.Controls[j].FindControl("fuAttachment");
LinkButton lnkView = (LinkButton)DataList2.Controls[j].FindControl("lnkView");
TextBox txtAnswerTypeDesc = (TextBox)DataList2.Controls[j].FindControl("txtAnswerTypeDesc");
Label lblerrorMessageHtmlCell = (Label)DataList2.Controls[j].FindControl("lblerrorMessageHtmlCell");
TextBox txtAttachFileDesc = (TextBox)DataList2.Controls[j].FindControl("txtAttachFileDesc");
if (lblHiddenFileName.Text == "")
{
if (Convert.ToInt32(QuestionId.Text) == Convert.ToInt32(btn.CommandArgument))
{
if (Uploader.HasFile)
{
lblerrorMessageHtmlCell.Visible = false;
FileInfo filedet = new FileInfo(Uploader.FileName);
string FileNameToCheck = Server.MapPath(DocumentPath + FileName) + filedet.Extension;
Uploader.SaveAs(Server.MapPath(DocumentPath + Uploader.FileName));
string OriginalName = Server.MapPath(DocumentPath + Uploader.FileName);
File.Copy(OriginalName, FileNameToCheck);
File.Delete(OriginalName);
lblHiddenFileName.Text = FileName + filedet.Extension;
lnkView.Visible = true;
Flag = 1;
break;
}
else
{
lblerrorMessageHtmlCell.Visible = true;
lblerrorMessageHtmlCell.Text = "No File To Upload.";
lblerrorMessageHtmlCell.ForeColor = System.Drawing.Color.Red;
Flag = 1;
break;
}
}
}
else
{
if (Uploader.HasFile)
{
lblerrorMessageHtmlCell.Visible = false;
Session["FileUploadObject"] = Uploader;
Session["FileNameToCheck"] = FileName;
Session["LabelFileName"] = lblHiddenFileName.Text;
trQuestionaries.Visible = false;
trPopupYesNo.Visible = true;
//Console.Beep(600, 300);
}
else
{
if (Convert.ToInt32(QuestionId.Text) == Convert.ToInt32(btn.CommandArgument))
{
lblerrorMessageHtmlCell.Visible = true;
lblerrorMessageHtmlCell.Text = "No File To Upload.";
lblerrorMessag
dA.d
20-Feb-13 2:16am
View
Thanks for replay..
115kb size file, but when i upload as first time its work.
dA.d
19-Feb-13 1:35am
View
Thanks for you quick replay,
my code work on local machine but on server shows the error of "ScriptResource.axd?d=" like this u have any solution for this please suggest me...
dA.d
30-May-12 6:42am
View
thanks for replay.....
suppose i am select year-2010 then shows the months like....
jan feb march apr
may june july aug
sep oct nov dec
in this format months will display with date.
dA.d
22-May-12 0:48am
View
Thanks for replay.....
can u explain in detail for this javascript.
how can i use in my page....
dA.d
22-May-12 0:38am
View
Thanks for replay......
can u show me javascript code for preventing for copy the text from file.
dA.d
14-May-12 5:57am
View
thanks for helping me...
dA.d
14-May-12 5:48am
View
Thanks for replay......
but i want to handle error using try and catch blocks,
and that FID value i want to pass in delete stored procedure as parameter value.
dA.d
14-May-12 5:45am
View
thanks again......
i want to pass FID value in delete stored procedure for that how can get FID in procedure.
i use like
DeleteStoreProcedureName(FID);
but compilation error is FID not exist.
dA.d
14-May-12 5:35am
View
Deleted
thanks for replay......
but i want to use try and catch blocks please show me how to use try and catch for handling that error.
dA.d
14-May-12 2:14am
View
Thanks for replay...
i want to delete record from table on specific row id for than i pass two parameters in stored procedure. passing that parameter we delete the specific row from table. and i used dbnull.value but it not accepted.
dA.d
14-May-12 1:41am
View
Thanks for reply..
in my table have some records only few records have FID=null and other records have unique value, so when i want to delete FID=null record then it will delete when i want to delete some other record which FID=12 so it will delete and then i pass Fid=12 in stored procedure.
dA.d
2-May-12 8:25am
View
thanks for help...
dA.d
2-May-12 5:36am
View
thanks for rply..
in this code when entered after 19 date means 20,21,22.....like then error is String was not recognized as a valid DateTime.
plz solve this problem..
dA.d
2-May-12 1:57am
View
thanks for rply...
i am using above code and entering some dates like.20/05/1990, 20/05/2013
then showing error message, plz explain me which date i can insert in textbox..?
dA.d
27-Apr-12 9:14am
View
protected void btnUpdate_Click(object sender, EventArgs e)
{
BAL.ManageFacultyStaff ObjBalMngFacultyStaff = new BAL.ManageFacultyStaff();
ENTITY.ManageFacultyStaff ObjEntityMngFacultyStaff = new ENTITY.ManageFacultyStaff();
System.Data.SqlTypes.SqlDateTime getDateTime;
getDateTime = SqlDateTime.Null;
ObjEntityMngFacultyStaff.UserId = Convert.ToInt32(lblUserId.Text);
ObjEntityMngFacultyStaff.LoginEmail = txtEmail.Text;
ObjEntityMngFacultyStaff.Password = txtPassword.Text;
ObjEntityMngFacultyStaff.FName = txtFName.Text;
ObjEntityMngFacultyStaff.MName = txtMName.Text;
ObjEntityMngFacultyStaff.LName = txtLName.Text;
if (rblGender.SelectedValue == "0")
{
ObjEntityMngFacultyStaff.Gender = false;
}
else
{
ObjEntityMngFacultyStaff.Gender = true;
}
if (txtBirthDate.Text != "")
{
ObjEntityMngFacultyStaff.Birthdate = DateTime.Parse(txtBirthDate.Text, System.Globalization.CultureInfo.CreateSpecificCulture("en-AU").DateTimeFormat);
}
else
{
ObjEntityMngFacultyStaff.Birthdate = getDateTime;
}
ObjEntityMngFacultyStaff.AddressLine1 = txtAddress1.Text;
ObjEntityMngFacultyStaff.AddressLine2 = txtAddress2.Text;
dA.d
2-Apr-12 4:49am
View
thanks for reply...
can u give me details for this....
dA.d
2-Apr-12 2:37am
View
dont change in database just when i insert date in dd/mm/yyyy format which is save in database in mm/dd/yyyy format
dA.d
2-Mar-12 3:54am
View
image save in same application(project solution)-- image folder. from the application i browse the image.
Thanks for rply.......
dA.d
27-Feb-12 23:30pm
View
this error comes "Could not load file or assembly 'CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified".
dA.d
27-Feb-12 22:51pm
View
sorry i am not understand ur solution plz give me detail info.
dA.d
26-Feb-12 22:55pm
View
yes, i want to define one fixed image in crystal report..
thanks for rply...
dA.d
24-Feb-12 1:01am
View
i am used insert picture object of crystal report and it works locally but on server image not displaying properlly. plz help for this problem...
thanks for rply...
dA.d
23-Feb-12 22:53pm
View
Deleted
i am insert the image in crystal report from the using following steps:
crystal report on design mode--> right click on report --> we get insert option--> click on picture option--> browse the image & put into the crystal report.
dA.d
23-Feb-12 2:06am
View
sory, but i want to insert image from the system general drive, not from the database.
dA.d
21-Feb-12 23:04pm
View
how to give two database connections in web.config file.
dA.d
15-Feb-12 23:21pm
View
i explain to u what is my problem.....
this is code behind page code.
button_click(object sender, EventArgs e) //event....
dataset = bal.storedprocedure(); //stored procedure call....
ToHTML(dataset.Tables[0], "SoftwareList.html", Page.Response); //function call......
public void ToHTML(DataTable dt, string filename, HttpResponse response)
{var html = ConvertToHtmlFile(dt);
}
public static string ConvertToHtmlFile(DataTable GetTable)
{//here i am using string builder
myBuilder.Append("<html>");
myBuilder.Append("<head>");
myBuilder.Append("<title>");
myBuilder.Append("Page-");
myBuilder.Append(Guid.NewGuid().ToString());
myBuilder.Append("</title>");
myBuilder.Append("</head>");
myBuilder.Append("<body>");
//here i am create table columns and rows using tr & td tags and store data in that form
//here i want give the links to second columns rows
myBuilder.Append("</body>");
myBuilder.Append("</html>");
}
dA.d
15-Feb-12 5:57am
View
i am export the datatable into html file using string builder on button click event. in that html file displaying two tables seperately so i want to give link to first table data that link going to second table data on same file.
dA.d
15-Feb-12 4:40am
View
i have one stored procedure in that procedure have two tables
that tables data convert in to html file and show both tables into the same html file.
dA.d
15-Feb-12 3:05am
View
i hv two tables in dataset in that of table i am converted to html file and i m getting the output in html file also but i want to both tables record display in same html file
dA.d
15-Feb-12 3:02am
View
Deleted
below is my code
<pre lang="c#">protected void btnHtml_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable("HTML");
MIEL.BAL.SoftwareListReport objSoftReport = new MIEL.BAL.SoftwareListReport();
DataSet ds = objSoftReport.SelectSoftwareListById(Convert.ToInt32(ddlSelectCustomer.SelectedValue));
//dt = ds.Tables[0];
//dt1 = ds.Tables[1];
ToHTML(ds.Tables[0], "SoftwareList.html", Page.Response);
}
private void ToHTML(DataTable dt, string filename, HttpResponse response)
{
var html = ConvertToHtmlFile(dt);
response.Clear();
response.AppendHeader("Content-Type", "text/html; charset=UTF-8");
response.AppendHeader("Content-disposition", "attachment; filename=" + filename);
response.Write(html);
response.Flush();
response.End();
}
public static string ConvertToHtmlFile(DataTable GetTable)
{
string myHtmlFile = "";
if ((GetTable == null))
{
throw new System.ArgumentNullException("GetTable");
}
else
{
//Continue.
}
//Get a worker object.
System.Text.StringBuilder myBuilder = new System.Text.StringBuilder();
//Open tags and write the top portion.
myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>");
//myBuilder.Append("<html>");
myBuilder.Append("<head>");
myBuilder.Append("<title>");
myBuilder.Append("Page-");
myBuilder.Append(Guid.NewGuid().ToString());
myBuilder.Append("</title>");
myBuilder.Append("</head>");
myBuilder.Append("<body>");
myBuilder.Append("<table border="1px" cellpadding="5" cellspacing="0" hold=" /> myBuilder.Append(" style="border: solid 1px Silver; font-size: x-small;">");
//Add the headings row.
myBuilder.Append("<tr align="left" valign="top">");
foreach (DataColumn myColumn in GetTable.Columns)
{
myBuilder.Append("<td align="left" valign="top">");
myBuilder.Append(myColumn.ColumnName);
myBuilder.Append("</td>");
}
myBuilder.Append("</tr>");
//Add the data rows.
foreach (DataRow myRow in GetTable.Rows)
{
myBuilder.Append("<tr align="left" valign="top">");
foreach (DataColumn myColumn in GetTable.Columns)
{
if (myColumn.ColumnName == "SoftwareName")
{
myBuilder.Append("<td align="left" valign="top">");
//myBuilder.Append("<a href=""> myRow[myColumn.ColumnName].ToString()</a>");
myBuilder.Append(myRow[myColumn.ColumnName].ToString());
myBuilder.Append("</td>");
}
else
{
myBuilder.Append("<td align="left" valign="top">");
myBuilder.Append(myRow[myColumn.ColumnName].ToString());
myBuilder.Append("</td>");
}
}
myBuilder.Append("</tr>");
}
//Close tags.
myBuilder.Append("</table>");
myBuilder.Append("</body>");
myBuilder.Append("</html>");
//Get the string for return.
myHtmlFile = myBuilder.ToString();
return myHtmlFile;
}</pre>
dA.d
15-Feb-12 3:01am
View
Deleted
below is my code
<pre lang="c#">protected void btnHtml_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable("HTML");
MIEL.BAL.SoftwareListReport objSoftReport = new MIEL.BAL.SoftwareListReport();
DataSet ds = objSoftReport.SelectSoftwareListById(Convert.ToInt32(ddlSelectCustomer.SelectedValue));
//dt = ds.Tables[0];
//dt1 = ds.Tables[1];
ToHTML(ds.Tables[0], "SoftwareList.html", Page.Response);
}
private void ToHTML(DataTable dt, string filename, HttpResponse response)
{
var html = ConvertToHtmlFile(dt);
response.Clear();
response.AppendHeader("Content-Type", "text/html; charset=UTF-8");
response.AppendHeader("Content-disposition", "attachment; filename=" + filename);
response.Write(html);
response.Flush();
response.End();
}
public static string ConvertToHtmlFile(DataTable GetTable)
{
string myHtmlFile = "";
if ((GetTable == null))
{
throw new System.ArgumentNullException("GetTable");
}
else
{
//Continue.
}
//Get a worker object.
System.Text.StringBuilder myBuilder = new System.Text.StringBuilder();
//Open tags and write the top portion.
myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>");
//myBuilder.Append("<html>");
myBuilder.Append("<head>");
myBuilder.Append("<title>");
myBuilder.Append("Page-");
myBuilder.Append(Guid.NewGuid().ToString());
myBuilder.Append("</title>");
myBuilder.Append("</head>");
myBuilder.Append("<body>");
myBuilder.Append("<table border="1px" cellpadding="5" cellspacing="0" hold=" /> myBuilder.Append(" style="border: solid 1px Silver; font-size: x-small;">");
//Add the headings row.
myBuilder.Append("<tr align="left" valign="top">");
foreach (DataColumn myColumn in GetTable.Columns)
{
myBuilder.Append("<td align="left" valign="top">");
myBuilder.Append(myColumn.ColumnName);
myBuilder.Append("</td>");
}
myBuilder.Append("</tr>");
//Add the data rows.
foreach (DataRow myRow in GetTable.Rows)
{
myBuilder.Append("<tr align="left" valign="top">");
foreach (DataColumn myColumn in GetTable.Columns)
{
if (myColumn.ColumnName == "SoftwareName")
{
myBuilder.Append("<td align="left" valign="top">");
//myBuilder.Append("<a href=""> myRow[myColumn.ColumnName].ToString()</a>");
myBuilder.Append(myRow[myColumn.ColumnName].ToString());
myBuilder.Append("</td>");
}
else
{
myBuilder.Append("<td align="left" valign="top">");
myBuilder.Append(myRow[myColumn.ColumnName].ToString());
myBuilder.Append("</td>");
}
}
myBuilder.Append("</tr>");
}
//Close tags.
myBuilder.Append("</table>");
myBuilder.Append("</body>");
myBuilder.Append("</html>");
//Get the string for return.
myHtmlFile = myBuilder.ToString();
return myHtmlFile;
}</pre>
dA.d
14-Feb-12 5:36am
View
public static string ConvertToHtmlFile(DataTable targetTable)
{
string myHtmlFile = "";
if ((targetTable == null))
{
throw new System.ArgumentNullException("targetTable");
}
else
{
//Continue.
}
//Get a worker object.
System.Text.StringBuilder myBuilder = new System.Text.StringBuilder();
//Open tags and write the top portion.
myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>");
myBuilder.Append("<head>");
myBuilder.Append("<title>");
myBuilder.Append("Page-");
myBuilder.Append(Guid.NewGuid().ToString());
myBuilder.Append("</title>");
myBuilder.Append("</head>");
myBuilder.Append("<body>");
myBuilder.Append("<table border='1px' cellpadding='5' cellspacing='0' ");
myBuilder.Append("style='border: solid 1px Silver; font-size: x-small;'>");
//Add the headings row.
myBuilder.Append("<tr align='left' valign='top'>");
foreach (DataColumn myColumn in targetTable.Columns)
{
myBuilder.Append("<td align='left' valign='top'");
myBuilder.Append(myColumn.ColumnName);
myBuilder.Append("");
}
myBuilder.Append("</tr>");
//Add the data rows.
foreach (DataRow myRow in targetTable.Rows)
{
myBuilder.Append("<tr align='left' valign='top'>");
foreach (DataColumn myColumn in targetTable.Columns)
{
myBuilder.Append("<td align='left' valign='top'>");
myBuilder.Append(myRow[myColumn.ColumnName].ToString());
myBuilder.Append("</td>");
}
myBuilder.Append("</tr>");
}
//Close tags.
myBuilder.Append("</table>");
myBuilder.Append("</body>");
myBuilder.Append("</html>");
//Get the string for return.
myHtmlFile = myBuilder.ToString();
return myHtmlFile;
}
above is my code but error occur in this line in my code "myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>");"
Show More