473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

StringBuilder

I don't know why but in my stringbuilder. The string is cut off I set the
size but it is still missing part of the string.

Here is the codebehind:

public System.Text.StringBuilder BindData(System.DateTime SDate,
System.DateTime EDate)
{
string strEventSelect="SELECT EVNR_tbl.* FROM EVNR_tbl, img_tbl WHERE
EVNR_tbl._Date BETWEEN '" + SDate.ToString("yyyy/MM/dd") + "' AND '" +
EDate.ToString("yyyy/MM/dd") + "' ORDER BY EVNR_tbl._Date ASC";
clubconn=new SqlConnection(strclubconn);
clubconn.Open();
dsClub=new DataSet();
clubadapt=new SqlDataAdapter(strEventSelect,clubconn);
clubadapt.FillSchema(dsClub,SchemaType.Source,"EVN R_tbl");
clubadapt.Fill(dsClub,"EVNR");

MailString=new System.Text.StringBuilder(5000);
// Set Email Body.
MailString.Append("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0
Transitional//EN' >");
MailString.Append("<HTML>");
MailString.Append("<HEAD>");
MailString.Append("<meta name='GENERATOR' Content='Microsoft Visual
Studio .NET 7.1'>");
MailString.Append("<meta name='CODE_LANGUAGE' Content='C#'>");
MailString.Append("<meta name='vs_defaultClientScript'
content='JavaScript'>");
MailString.Append("<meta name='vs_targetSchema'
content='http://schemas.microsoft.com/intellisense/ie5'>");
MailString.Append("</HEAD>");
MailString.Append("<body MS_POSITIONING='GridLayout' bgColor='black'>");
MailString.Append("<form id='Form1' method='post' runat='server'>");
MailString.Append("<table borderColor='#ffffff' cellSpacing='0'
cellPadding='0' width='500' align='center' border='1'>");
MailString.Append("<tr>");
MailString.Append("<td>");
MailString.Append("<table cellSpacing='0' cellPadding='0' width='100%'
border='0'>");
MailString.Append("<tr>");
MailString.Append("<td colspan='2'><IMG
SRC='http://www.sonar.bc.ca/images/Header.jpg'></td>");
MailString.Append("</tr>");
MailString.Append("<tr>");
MailString.Append("<td colspan='2' style='HEIGHT: 48px'>");
MailString.Append("<table cellpadding='10' cellspacing='0' border='0'
width='100%'>");
MailString.Append("<tr>");
MailString.Append("<td style='FONT-SIZE: 10px; COLOR: white; FONT-FAMILY:
Verdana'>" + EMessage + "</td>");
MailString.Append("</tr>");
MailString.Append("</table>");
MailString.Append("</td>");
MailString.Append("</tr>");
MailString.Append("<tr>");
MailString.Append("<td>");
MailString.Append("<table cellpadding='10' cellspacing='0' border='0'
width='100%'>");
MailString.Append("<tr>");
MailString.Append("<td style='FONT-SIZE: 10px; WIDTH: 251px; COLOR:
white; FONT-FAMILY: Verdana' vAlign='Top'>");
DataTable dt=dsClub.Tables["EVNR"];
foreach(DataRow dr in dt.Rows)
{
MailString.Append(System.Convert.ToDateTime(dr["_Date"]) + " " +
dr["EventTitle"] + "<br>");
MailString.Append(dr["Description"].ToString().Replace("\n","<br>").Trim() + "<br>");
MailString.Append("For more details press <a
href='http://www.sonar.bc.ca/EventCalendar.aspx'> here </a>" + "<br>");
}
MailString.Append("</td>");
MailString.Append("<td style='FONT-SIZE: 10px; COLOR: white; FONT-FAMILY:
Verdana' vAlign='top'>");
foreach(ListItem i in IMGList.Items)
{
if(i.Selected)
{
MailString.Append("<img src='http://www.sonar.bc.ca/BroadcastIMG/" +
i.Text + "'" + ">" +"<br>");
}
}
MailString.Append("</td>");
MailString.Append("</tr>");
MailString.Append("</table>");
MailString.Append("</td>");
MailString.Append("</tr>");
MailString.Append("</table>");
MailString.Append("</td>");
MailString.Append("</tr>");
MailString.Append("</table>");
MailString.Append("</form>");
MailString.Append("</body>");
MailString.Append("</HTML>");

return MailString;
}
if someone can tell me what I am doing wrong I'd greatly appreciate it.

Thank you,
Nov 19 '05 #1
4 2445
TJS
probaly a mismatched quote ...

check this line

MailString.Append("<img src='http://www.sonar.bc.ca/BroadcastIMG/" +
i.Text + "'" + ">" +"<br>");
Nov 19 '05 #2
TJS
probaly a mismatched quote ...

check this line

MailString.Append("<img src='http://www.sonar.bc.ca/BroadcastIMG/" +
i.Text + "'" + ">" +"<br>");
Nov 19 '05 #3
What part is exactly missing?

Gabriel Lozano-Morán
Nov 19 '05 #4
What part is exactly missing?

Gabriel Lozano-Morán
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Kevin C | last post by:
Quick Question: StringBuilder is obviously more efficient dealing with string concatenations than the old '+=' method... however, in dealing with relatively large string concatenations (ie,...
16
by: Alvin Bruney | last post by:
Is string builder intelligent enough to handle concats without behaving like string? Consider myStringBuilder.Append("one" + "two") what does the '+' do here? Because this syntax is also...
20
by: Alvin Bruney | last post by:
On the advice of a user, I've timed stringbuilder v string. Here are the results. Here are the numbers: Total # queries 3747 Time in Milliseconds StringBuilder: String...
9
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a...
38
by: Kevin C | last post by:
Quick Question: StringBuilder is obviously more efficient dealing with string concatenations than the old '+=' method... however, in dealing with relatively large string concatenations (ie,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.