Here I write to a text file. I am looking for a keyword Raiserrorin an sql file, and if this keyword exists, I must write this line.
He writes how
LineNo : 66 : raiserror ('Sequence number cannot be blank',16,1)
But I need to write only
LineNo : 66 : Sequence number cannot be blank
Is it possible. If so, how to crop .. 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?
source
share