Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with repeater control and/or timeout issue.

Status
Not open for further replies.

wvdba

IS-IT--Management
Jun 3, 2008
465
US
hi.
i have a page where you enter last name and first name and the page gets the data from oracle table and displays any last name that matches using a few first letters of the name. however, if they leave the first name blank, it still fetches all the matches based on last name. now, here's the strange part:
if the number of rows is 2 or 3, or 10 or 15 there's no problem
but, if the number of rows are, let's say 50 or 60, then the repeater control malfunctions and the data values are set to null, which the repeater control doesn't like.
any suggestions would be greatly appreciated.
thanks.
 
Sounds like you are doing an OUTER JOIN somewhere, and when a search field is left blank, then NULLs are returned. As Mark points out, first debug your actual code that retrieves the data.
 
there's no outer join.
the query is pretty straight forward:
sql="select last_name, first_name from tbl1 & _
where last_name like('%" & entered_last_name & "%')" & _
and first_name like ('%" & entered_first_name & "%')"
the problem is that when there's only 2 or 3 rows, it works, but when the result is 50-60, it messes up the repeater control. i have already tried this with sqlplus and i know what the results are.
thanks.
 
if found out what the problem is. it has nothing to do with the volume of rows. it just happens that one record has a null field (middle name) in it, which is a legitimate value and possibility and microsoft's vb.net is too dumb (as usual) to be able to handle that correctly. so, i had to code an oracle function around the possible null field to prevent it from erroring out. FYI the function:
NVL(middle_name, 'NMN')
which means if middle_name has no value, substitute "NMN" and keep going.
thanks everybody. i'm sure i'll be running into some other issues as i move this project forward.
thanks.
 
it just happens that one record has a null field (middle name) in it, which is a legitimate value and possibility and microsoft's vb.net is too dumb (as usual) to be able to handle that correctly.
What's that saying about a workman and his tools? The fact that you didn't handle a null value at a level where they were clearly present (you said you had already seen the results at a sqlplus level) doesn't make a language "dumb".

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
high,
with all due respect,
most languages do accept a null value as a legitimate VALUE, INCLUDING sqlplus, golden, vb.script, classic asp and many other languages, but vb.net is just not up to par to do anything with a null value. it's disappointing.
 
I think you're generalising too much as pretty much all of the .NET languages (including VB.NET) have far greater support for object types than any of the languages you listed above.

most languages do accept a null value as a legitimate VALUE
As does VB.NET, but it depends on what object type you are working with and what you try to do with that value e.g. this would still work:
Code:
Dim s As String = Nothing
Response.Write(s)
but this wouldn't:
Code:
Dim s As String = Nothing
Response.Write(s.ToString)

I'd suggest reading up on nullable types if that's your primary concern as I think you've failed to understand how they work. In fact had you been using C# for this project, the same thing would have happened so do you think it's still the fault of the VB.NET language?.

Also, the fact that you say it's disappointing further demonstrates this need for more research as you wrongly assume it is the languages fault and not your own for not handling the scenario (which is actually more disappointing I think).



Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
nothing/null is not a value where as "" or string.Empty is a value of a zero length string. the 2 have completely different meanings. some languages, like .net, define this explicitly. other languages, like the ones you described above, define this implicitly.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
ca8msm,
thanks for clarifying some issues. i don't think you understood my point. the fact of the matter is that the field in the database table does have a null value. and vb.net should write that field out regardless of whatever the heck is in the field, null, whatever. actually, oracle handles these values better. it writes them out regardless of what the value is. classic asp doesn't have this problem, that the developer should provide for errors on the content of the field. the database table has already taken care of that. the field can be defined as NOT NULL / required, other constraints, etc. i think vb.net is kind of overreaching in trying to police values in a database table field that the platform already has taken care of. and don't forget that c# in .net is NOT a microsoft thing. it's a legacy of unix/c platform. anyway, things are looking up and i'm in the processing of wrapping up this project.
thanks again.
 
i don't think you understood my point
I understand it, I just think that it's because of your lack of understanding of the objects involved that makes you think it is a fault rather than a design issue.

the fact of the matter is that the field in the database table does have a null value. and vb.net should write that field out regardless of whatever the heck is in the field, null, whatever
No, it shouldn't write it out as you are trying to perform a string based function on something that isn't a string (Jason has summed this up quite nicely for you in his post above).

classic asp doesn't have this problem
It isn't a problem, it is your understanding of what you think should be happening which is incorrect (again, see Jason's post about implicit vs explicit).

i think vb.net is kind of overreaching in trying to police values in a database table field
It isn't trying to police ANYTHING in a database. When you have cast that value to a .NET object, that is when it polices the input. And you have broke the rules of that object, not the database field.

c# in .net is NOT a microsoft thing. it's a legacy of unix/c platform
C# IS a microsoft language, it uses the .NET framework and generates CIL just like any other .NET language (VB.NET, C#, J# etc). If you mean that it evolved from a C (and C++) background and follows similar syntax, then yes you may be able describe that as it's evolution path but it certainly isn't a legacy unix language.

Anyway, you now know how null strings work in .NET so any future ASP.NET projects you do (using C#, VB.NET etc) hopefully won't catch you out with the same problem.

Good luck.

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top