Click here to Skip to main content
15,887,444 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Dinamically created gridview not handling SelectedIndexChanged Pin
Adam R Harris15-Jun-10 9:06
Adam R Harris15-Jun-10 9:06 
QuestionUsing Resource file in C# .NET Pin
VOITDOTNET11-Jun-10 7:10
VOITDOTNET11-Jun-10 7:10 
AnswerRe: Using Resource file in C# .NET Pin
Adam R Harris11-Jun-10 8:17
Adam R Harris11-Jun-10 8:17 
GeneralRe: Using Resource file in C# .NET Pin
VOITDOTNET11-Jun-10 9:53
VOITDOTNET11-Jun-10 9:53 
AnswerRe: Using Resource file in C# .NET Pin
Sandeep Mewara11-Jun-10 10:28
mveSandeep Mewara11-Jun-10 10:28 
QuestionSearch and Replace String Value Pin
AsianRogueOne11-Jun-10 4:01
AsianRogueOne11-Jun-10 4:01 
AnswerRe: Search and Replace String Value Pin
Rhys Jacob11-Jun-10 4:51
Rhys Jacob11-Jun-10 4:51 
GeneralRe: Search and Replace String Value Pin
AsianRogueOne11-Jun-10 5:04
AsianRogueOne11-Jun-10 5:04 
Hi,

I started writing a function to do the replace/insert but ran into issue when there are more then one "AND" then follow by "OR", the "(" get insert after the first "AND". Also when there blank space after the "OR" at the end of the string the function fail.

Thanks,
DocHoilday

Function codes:

Private Function ReplaceString(ByVal strValue As String) As String

Dim andIndex As Integer = strValue.IndexOf("AND")
Dim blankIndex As Integer = strValue.IndexOf("Blank")
Dim orIndex As Integer = strValue.IndexOf("OR")

Dim nextAndIndex As Integer = strValue.IndexOf("AND", andIndex + 3)

Dim secondBlankIndex As Integer = strValue.IndexOf("Blank", blankIndex + 5)

Dim temp As String = String.Empty


if orIndex > andIndex AndAlso orIndex < secondAndIndex Then
temp = strValue.Substring(0, andIndex + 3) + " ("
temp += strValue.Substring(andIndex + 3, secondAndIndex - andIndex - 3).Trim() + ") "
temp += strValue.Substring(secondAndIndex)

ElseIf orIndex > andIndex AndAlso orIndex < secondBlankIndex Then
temp = strValue.Substring(0, andIndex + 3) + " ("
temp += strValue.Substring(blankIndex + 5, secondBlankIndex - blankIndex - 5).Trim() + ") "
temp += strValue.Substring(secondBlankIndex)

End If
Return temp
End Function



Here is the SP code:

CREATE PROCEDURE Get_Build_My_Report
(
@Application_id CHAR(5),
@DisplayColumn VARCHAR(2000),
@Filters VARCHAR(1000) = NULL
)
AS

DECLARE @Select VARCHAR(60)
DECLARE @FROM VARCHAR(60)
DECLARE @JOIN VARCHAR (2000)
DECLARE @WHERE VARCHAR(60)
DECLARE @TempColumnName VARCHAR(1000)
DECLARE @Var VARCHAR(1000)

SET @Select = 'SELECT'
SET @FROM = 'FROM Issues_Tracking it'
SET @JOIN = 'LEFT JOIN User_mstr um ON it.Assigned_To_id = um.userid AND it.application_id = um.application_id
LEFT JOIN Status s ON it.status = s.status_id
LEFT JOIN NGModules m ON it.module = m.mod_id AND it.application_id = m.application_id
LEFT JOIN Rank_level rl ON it.rank = rl.rank_id
LEFT JOIN NGProducts p ON it.product = p.product_id
LEFT JOIN Request_Type rt ON it.Request_Type = rt.Request_Type_id
LEFT JOIN practice pr ON it.Practice_id = pr.practice_id
LEFT JOIN Response r ON it.Submitted_to_Vendor = r.Answer_id
LEFT JOIN Response r2 ON it.Issues_Known_To_Vendor = r2.Answer_id
LEFT JOIN Environment e ON it.Environment = e.Environment_id
LEFT JOIN User_mstr um2 ON it.Fixed_by = um2.userid AND it.application_id = um.application_id
LEFT JOIN User_mstr um3 ON it.tested_by = um3.userid AND it.application_id = um.application_id
LEFT JOIN User_mstr um4 ON it.tested_2_by = um4.userid AND it.application_id = um.application_id
LEFT JOIN User_mstr um5 ON it.tested_3_by = um5.userid AND it.application_id = um.application_id
LEFT JOIN Test_Status ts ON it.test_result = ts.test_id
LEFT JOIN Test_Status ts2 ON it.test_2_result = ts2.test_id
LEFT JOIN Test_Status ts3 ON it.test_3_result = ts3.test_id '

SET @WHERE = 'WHERE it.Application_id ='

EXEC(@Select + ' ' + @DisplayColumn + ' '+
@FROM + ' ' + @JOIN + ' ' + @WHERE + ' ' + @Application_id + ' ' + @Filters)

SET QUOTED_IDENTIFIER OFF
GeneralRe: Search and Replace String Value Pin
AsianRogueOne11-Jun-10 5:08
AsianRogueOne11-Jun-10 5:08 
GeneralRe: Search and Replace String Value Pin
Rhys Jacob11-Jun-10 5:21
Rhys Jacob11-Jun-10 5:21 
GeneralRe: Search and Replace String Value Pin
AsianRogueOne11-Jun-10 5:34
AsianRogueOne11-Jun-10 5:34 
GeneralRe: Search and Replace String Value Pin
Rhys Jacob11-Jun-10 5:56
Rhys Jacob11-Jun-10 5:56 
GeneralRe: Search and Replace String Value Pin
AsianRogueOne11-Jun-10 6:27
AsianRogueOne11-Jun-10 6:27 
GeneralRe: Search and Replace String Value Pin
Rhys Jacob13-Jun-10 21:43
Rhys Jacob13-Jun-10 21:43 
AnswerRe: Search and Replace String Value Pin
AsianRogueOne21-Jun-10 9:57
AsianRogueOne21-Jun-10 9:57 
QuestionScriptManager.RegisterClientScriptBlock issue Pin
trilokharry11-Jun-10 3:44
trilokharry11-Jun-10 3:44 
AnswerRe: ScriptManager.RegisterClientScriptBlock issue Pin
Sandeep Mewara11-Jun-10 6:48
mveSandeep Mewara11-Jun-10 6:48 
QuestionBind asp.net menu control with treeview Pin
yesu prakash11-Jun-10 3:21
yesu prakash11-Jun-10 3:21 
AnswerRe: Bind asp.net menu control with treeview Pin
Sandeep Mewara11-Jun-10 6:57
mveSandeep Mewara11-Jun-10 6:57 
QuestionExport data to excel in formatted way Pin
Karan_TN11-Jun-10 1:21
Karan_TN11-Jun-10 1:21 
AnswerRe: Export data to excel in formatted way Pin
Peace ON11-Jun-10 2:28
Peace ON11-Jun-10 2:28 
QuestionHtmlTabHTleRow Pin
siva45511-Jun-10 0:11
siva45511-Jun-10 0:11 
AnswerRe: HtmlTabHTleRow Pin
saini arun11-Jun-10 3:20
saini arun11-Jun-10 3:20 
QuestionLoading controls on page with UpdatePanel Pin
Łukasz Nowakowski10-Jun-10 23:50
Łukasz Nowakowski10-Jun-10 23:50 
AnswerRe: Loading controls on page with UpdatePanel Pin
Brij10-Jun-10 23:56
mentorBrij10-Jun-10 23:56 

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.