473,654 Members | 3,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Last row condition in datarow

Hi everyone,

I like add \r\n to all my rows except for the last row. How do I check
for the last in the following code?

StringBuilder sb = new StringBuilder() ;
foreach (DataRow row in rows)
{
sb.Append(row["Mesg"].ToString());

if (?????????????? ????) {
sb.Append("\r\n ");
}

}

Thanks
Maz.

Mar 27 '06 #1
0 941

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

Similar topics

7
2153
by: Scott W Gifford | last post by:
Hello, I'm considering using XML to represent a stream of location information, and XPath to do queries against it. I've got most of it figured out (at least on paper), but I can't figure out how to create an XPath statement asking for the "last node with a value less than" a given value. I need this to be able to ask "Where was Scott at 11:00 yesterday", which should find the last sighting of Scott before or at 11:00
2
1695
by: Sreedhar Vankayala | last post by:
Hi, I have a table IV00108wc which contains several thousand records in whcih ITEMNMBR is the primary key. I have a com+ object returning recordset which has ITEMNMBR and another details related. I want to query another table based on Com+ object recordset. Select distinct WebClas1 from IV00108wc where ItemNmbr in (...).
4
7809
by: Bernie V | last post by:
Hi group, Is it possible to use a condition in a repeater control ? I 'd like to use a condition to create this <a href='<%#DataBinder.Eval(Container.DataItem,"nieuwsid")%>.aspx'> part of the repeater At the moment I use "nieuwsid" to make the url but in some cases it has to be <a href='wcharts.aspx'> Is that possible ?
3
3955
by: brix_zx2 | last post by:
I have an Excel Spreadsheet I want to import the records (5 fields) into an access 2000 DB. Went on the net looking and found stuff for SQL (which I don't know a thing about) and now I'm confused. (Using VB.NET 2k3) Any help would be appreciated. Here is the code I have.... It doesn't work cause it errors out after the bold comment line. Dim MyCommand As System.Data.OleDb.OleDbDataAdapter Dim MyConnection As...
1
16421
by: maflatoun | last post by:
Hi everyone, I like add \r\n to all my rows except for the last row. How do I check for the last in the following code? StringBuilder sb = new StringBuilder(); foreach (DataRow row in rows) { sb.Append(row.ToString());
6
5779
by: magix | last post by:
Hi, when I read entries in file i.e text file, how can I determine the first line and the last line ? I know the first line of entry can be filtered using counter, but how about the last line of entry in EOF while loop ? while (! file.eof() ) { ....
27
1711
by: pugalenthi | last post by:
I have to add a value to an empty field in the last row of the table using C#. What changes should i make to the following code so that i can set 'thisRow' to last row in the table rather than to a new row. DataRow thisRow = thisDataSet.Tables.NewRow(); thisRow = Exittime; thisDataSet.Tables.Rows.Add(thisRow);
7
4003
by: ramana | last post by:
I'm wondering if someone could point me to the flaw in the following code that uses the while(!FP.eof()) condition to read the input data. This condition is reading the last data point of the file twice. #include <iostream> #include <fstream> using namespace std; int main(int argc, char **argv) { double x;
4
1447
by: skanemupp | last post by:
it seems to me from my results that when i use a while-loop it will execute once after the condition is met. ie the conditions is met the code executes one time more and then quits.
0
8376
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8489
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6161
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.