Go Back   SitePoint Forums > Forum Index > Program Your Site > .NET
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Jul 14, 2005, 00:26   #1
ahooi
SitePoint Member
 
Join Date: Jul 2005
Posts: 7
Exclamation [important]problem with rowfilter

Hi,
can anyone please try to filter the following data using rowfilter and see whether it works or not.
Note: Have to escape [ and ].So, [ is written as [[] and ] is written as []]. All the data is stored as NVARCHAR (50) except CourseId is stored as integer.

i'm using visual basic.net V1.1 and Microsoft SQL Enterprise Manager Microsoft Corporation Version: 8.0 as my database.

When the data are stored as unicode, the rowfilter works properly. However, when the data are stored
as NVARCHAR, the rowfilter is not working properly. Is is it because the data are stored as
NVARCHAR that makes rowfilter doesn't works properly? Besides that, when there are too many pair of square brackets in the string, the rowfilter will also work improperly. Is it because there is an error in the casting of my store procedure?


There are five fields in the database which are CourseId, CourseCode, CourseName, CourseType and Part.

Three records in the database are:
CourseId CourseCode CourseName CourseType Part
1 1222 - 2201 ภาษาไทยเพื่อการสื่อสาร science 1
3 1212 - 2200 วิทยาศาสตร์พื้นฐาน business 2
12 1122 - 3201 วิถีธรรมวิถีไทย technology 1


i will use the stored procedure to concatenate all the fields so that the three records will be retrieved in the form:
1# [1222 - 2201] [ภาษาไทยเพื่อการสื่อสาร] [science] [1]
3# [1212 - 2200] [วิทยาศาสตร์พื้นฐาน] [business] [2]
12# [1122 - 3201] [วิถีธรรมวิถีไทย] [technology] [1]

The store procedure is :
SELECT Cast(a.CourseId as varchar(10) ) +'# '
+ '[' + a.CourseCode+'] [' + a.CourseName+'] [' +a.CourseType +'] ['+a.CoursePart+']' AS CourseIntake
FROM Course a

the rowfilter is connected to the store procedure.

Let say i want to get the third record with one of the string below, i can get the desired data.
'%12%'
'%12#%'
'%[[]%'
'%[]]%'
'%[[]1122%'
'%[[]1122 - 3201[]] [[]วิถีธรรมวิถีไทย []]%'
'%#%'
'%-%'
'%วิถีธรรมว%'


However, i can't get the third record if i use one of thestring below.
'%# %' (a space after #)
'%# [[]%'
'%12# [[]%'
'%12# %' (a space after #)
'%# [[]1122%'
'%12# [[]1122 - 3201[]] [[]วิถีธรรมวิถีไทย []]%'
'%12# [[]1122 - 3201[]] [[]วิถีธรรมวิถีไทย[]] [[]technology[]] [[]3[]]%'


Can you help me?

You can reply to my gmail account heng81@gmail.com.
Thanks
ahooi is offline   Reply With Quote
 

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 03:46.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved