473,414 Members | 1,667 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,414 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 2447
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,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.