Click here to Skip to main content
15,909,440 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Inheritance question Pin
Colin Angus Mackay22-Jan-08 0:06
Colin Angus Mackay22-Jan-08 0:06 
GeneralRe: Inheritance question Pin
Veldrain22-Jan-08 6:13
Veldrain22-Jan-08 6:13 
AnswerRe: Inheritance question Pin
Guffa22-Jan-08 3:04
Guffa22-Jan-08 3:04 
GeneralKey board shortcuts are not displayed on the form until user press Alt Key Pin
Sipder21-Jan-08 18:42
Sipder21-Jan-08 18:42 
GeneralRe: Key board shortcuts are not displayed on the form until user press Alt Key Pin
John_Adams21-Jan-08 20:37
John_Adams21-Jan-08 20:37 
GeneralRe: Key board shortcuts are not displayed on the form until user press Alt Key Pin
Sipder22-Jan-08 20:51
Sipder22-Jan-08 20:51 
GeneralRe: Key board shortcuts are not displayed on the form until user press Alt Key Pin
Dave Kreskowiak22-Jan-08 5:00
mveDave Kreskowiak22-Jan-08 5:00 
GeneralSearch a word in a .txt file and add some content [modified] Pin
HenrydeSousa21-Jan-08 14:41
HenrydeSousa21-Jan-08 14:41 
Hi guys.

I have the script of a stored procedure in a .txt file. I need to search for
a particular word in the file and add a line with information above that word.
The file contains this information:


CREATE PROCEDURE SalesByCategory<br />
    @CategoryName nvarchar(15), @OrdYear nvarchar(4) = '1998'<br />
AS ---------------WORD TO SEARCH---------------<br />
IF @OrdYear != '1996' AND @OrdYear != '1997' AND @OrdYear != '1998' <br />
BEGIN<br />
	SELECT @OrdYear = '1998'<br />
END<br />
<br />
SELECT ProductName,<br />
	TotalPurchase=ROUND(SUM(CONVERT(decimal(14,2), OD.Quantity * (1-OD.Discount) * OD.UnitPrice)), 0)<br />
FROM [Order Details] OD, Orders O, Products P, Categories C<br />
WHERE OD.OrderID = O.OrderID <br />
	AND OD.ProductID = P.ProductID <br />
	AND P.CategoryID = C.CategoryID<br />
	AND C.CategoryName = @CategoryName<br />
	AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear<br />
GROUP BY ProductName<br />
ORDER BY ProductName




I need to search for the AS word or the AS clause, you know the one that is after the parameters definition.
Once i have found that word i need to add the WITH ENCRYPTION clause above the AS CLAUSE, then the script would
look like this:


CREATE PROCEDURE SalesByCategory<br />
    @CategoryName nvarchar(15), @OrdYear nvarchar(4) = '1998'<br />
WITH ENCRYPTION ---------------ADDED WORD---------------<br />
AS ---------------WORD SEARCHED---------------<br />
IF @OrdYear != '1996' AND @OrdYear != '1997' AND @OrdYear != '1998' <br />
BEGIN<br />
	SELECT @OrdYear = '1998'<br />
END<br />
<br />
SELECT ProductName,<br />
	TotalPurchase=ROUND(SUM(CONVERT(decimal(14,2), OD.Quantity * (1-OD.Discount) * OD.UnitPrice)), 0)<br />
FROM [Order Details] OD, Orders O, Products P, Categories C<br />
WHERE OD.OrderID = O.OrderID <br />
	AND OD.ProductID = P.ProductID <br />
	AND P.CategoryID = C.CategoryID<br />
	AND C.CategoryName = @CategoryName<br />
	AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear<br />
GROUP BY ProductName<br />
ORDER BY ProductName


So...what i need to do is searching a word in the text file and then add a line above that word.
I have some ideas in my mind but i would like to know your opinions about how i could solve this.

Thanks for your time and regards...


Henry de Sousa

modified on Monday, January 21, 2008 8:56:05 PM

GeneralRe: Search a word in a .txt file and add some content Pin
Steven J Jowett22-Jan-08 5:19
Steven J Jowett22-Jan-08 5:19 
GeneralRe: Search a word in a .txt file and add some content Pin
HenrydeSousa24-Jan-08 6:00
HenrydeSousa24-Jan-08 6:00 
QuestionRe: VB6 - getting contents of registry entry [modified] Pin
mla15421-Jan-08 11:58
mla15421-Jan-08 11:58 
QuestionRe: VB6 - getting contents of registry entry [modified] Pin
mla15422-Jan-08 4:43
mla15422-Jan-08 4:43 
GeneralDisplaying data in a gridview programatically Pin
solarthur0121-Jan-08 11:26
solarthur0121-Jan-08 11:26 
GeneralRe: Displaying data in a gridview programatically Pin
Usharva21-Jan-08 19:34
Usharva21-Jan-08 19:34 
Generalnumber of rows retrieved using a select statement and a table adapter Pin
AAGTHosting21-Jan-08 9:23
AAGTHosting21-Jan-08 9:23 
GeneralRe: number of rows retrieved using a select statement and a table adapter Pin
Steven J Jowett21-Jan-08 10:38
Steven J Jowett21-Jan-08 10:38 
GeneralRe: number of rows retrieved using a select statement and a table adapter Pin
AAGTHosting21-Jan-08 12:52
AAGTHosting21-Jan-08 12:52 
GeneralRe: number of rows retrieved using a select statement and a table adapter Pin
Steven J Jowett21-Jan-08 22:16
Steven J Jowett21-Jan-08 22:16 
GeneralRe: number of rows retrieved using a select statement and a table adapter Pin
AAGTHosting21-Jan-08 12:57
AAGTHosting21-Jan-08 12:57 
GeneralSet ListView Item to Selected Pin
VFaul21-Jan-08 7:45
VFaul21-Jan-08 7:45 
GeneralRe: Set ListView Item to Selected Pin
VFaul21-Jan-08 8:41
VFaul21-Jan-08 8:41 
GeneralRestricting multiple instance of application Pin
manisghouri21-Jan-08 2:11
manisghouri21-Jan-08 2:11 
GeneralRe: Restricting multiple instance of application Pin
Steven J Jowett21-Jan-08 2:26
Steven J Jowett21-Jan-08 2:26 
GeneralRe: Restricting multiple instance of application Pin
manisghouri21-Jan-08 3:11
manisghouri21-Jan-08 3:11 
GeneralRe: Restricting multiple instance of application Pin
Steven J Jowett21-Jan-08 4:15
Steven J Jowett21-Jan-08 4:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.