Here i am writing into a text file..I am searching for a key word Raiserror in a sql file and if that keyword exist i have to write that line..
It is writing like
LineNo : 66 : raiserror ('Sequence number cannot be blank',16,1)
But i need to write only
LineNo : 66 : Sequence number cannot be blank
Is this possible..If so how to trim..
Here is my code
while ((line = file.ReadLine()) != null)
{
if (line.IndexOf("Raiseerror", StringComparison.CurrentCultureIgnoreCase) != -1)
{
dest.WriteLine("LineNo : " + counter.ToString() + " : " + " " + line.TrimStart());
}
counter++;
}
file.BaseStream.Seek(0, SeekOrigin.Begin);
counter = 1;
Any Suggestion?
Try to use this