473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

.net VS 05 HELL!

NuB
OK, here is the story, i have text boxes to allow the user enter information
for a search. I have my SQL that has LIKE in the where clause, in the query
builder the SQL works correctly, if nothing is entered all the data is
returned, if i enter in search criteria that data is returned. NOW, when i
try to do the same exact thing on my web form, it does not work. the grid
will only populate with data if I enter something in for search critia. AND
the grid will not work if I have more then 1 parameter in my where clause:
here is my SQL that works in the querybuilder

SELECT id, Officename, FirstName + ' ' + LastName AS FullName, Region,
FROM dbo.SalesTeam
WHERE (@FirstName IS NULL OR
FirstName LIKE '%' + @FirstName ) AND (@LastName IS
NULL OR
LastName LIKE '%' + @LastName ) AND (@Region IS NULL
OR Region LIKE '%' + @Region ) )

why will this work in query builder but not on the web form?
Jan 20 '06 #1
6 1087
I don't have an answer on why it would be working in one place and not the
other, but have you tried putting your SQL into a stored procedure and then
trying to use that? Just something to use for troubleshooting.

"NuB" wrote:
OK, here is the story, i have text boxes to allow the user enter information
for a search. I have my SQL that has LIKE in the where clause, in the query
builder the SQL works correctly, if nothing is entered all the data is
returned, if i enter in search criteria that data is returned. NOW, when i
try to do the same exact thing on my web form, it does not work. the grid
will only populate with data if I enter something in for search critia. AND
the grid will not work if I have more then 1 parameter in my where clause:
here is my SQL that works in the querybuilder

SELECT id, Officename, FirstName + ' ' + LastName AS FullName, Region,
FROM dbo.SalesTeam
WHERE (@FirstName IS NULL OR
FirstName LIKE '%' + @FirstName ) AND (@LastName IS
NULL OR
LastName LIKE '%' + @LastName ) AND (@Region IS NULL
OR Region LIKE '%' + @Region ) )

why will this work in query builder but not on the web form?

Jan 20 '06 #2
NuB
yeah, i did that as well, and when i try and call the SP it does the same
thing, It executes in query builder but one the form it will not load the
Grid. This is driving me insane
"TJ Nelson" <TJ******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
I don't have an answer on why it would be working in one place and not the
other, but have you tried putting your SQL into a stored procedure and
then
trying to use that? Just something to use for troubleshooting.

"NuB" wrote:
OK, here is the story, i have text boxes to allow the user enter
information
for a search. I have my SQL that has LIKE in the where clause, in the
query
builder the SQL works correctly, if nothing is entered all the data is
returned, if i enter in search criteria that data is returned. NOW, when
i
try to do the same exact thing on my web form, it does not work. the grid
will only populate with data if I enter something in for search critia.
AND
the grid will not work if I have more then 1 parameter in my where
clause:
here is my SQL that works in the querybuilder

SELECT id, Officename, FirstName + ' ' + LastName AS FullName,
Region,
FROM dbo.SalesTeam
WHERE (@FirstName IS NULL OR
FirstName LIKE '%' + @FirstName ) AND (@LastName IS
NULL OR
LastName LIKE '%' + @LastName ) AND (@Region IS
NULL
OR Region LIKE '%' + @Region ) )

why will this work in query builder but not on the web form?

Jan 20 '06 #3
ME
Perhaps the control is passing NULL and not DBNULL. You might try assigning
a default value to the parameter in the stored procedure or query.

Just my 2 cents.

Thanks,

Matt

"TJ Nelson" <TJ******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
I don't have an answer on why it would be working in one place and not the
other, but have you tried putting your SQL into a stored procedure and
then
trying to use that? Just something to use for troubleshooting.

"NuB" wrote:
OK, here is the story, i have text boxes to allow the user enter
information
for a search. I have my SQL that has LIKE in the where clause, in the
query
builder the SQL works correctly, if nothing is entered all the data is
returned, if i enter in search criteria that data is returned. NOW, when
i
try to do the same exact thing on my web form, it does not work. the grid
will only populate with data if I enter something in for search critia.
AND
the grid will not work if I have more then 1 parameter in my where
clause:
here is my SQL that works in the querybuilder

SELECT id, Officename, FirstName + ' ' + LastName AS FullName,
Region,
FROM dbo.SalesTeam
WHERE (@FirstName IS NULL OR
FirstName LIKE '%' + @FirstName ) AND (@LastName IS
NULL OR
LastName LIKE '%' + @LastName ) AND (@Region IS
NULL
OR Region LIKE '%' + @Region ) )

why will this work in query builder but not on the web form?

Jan 20 '06 #4
NuB
tried that, I have it working with passing 1 parameter but anymore then
that, nothing.

I'm thinking of just coding this in the code behind and screw this inline
model
"ME" <tr*********@comcast.netREMOVETHIS> wrote in message
news:9M********************@comcast.com...
Perhaps the control is passing NULL and not DBNULL. You might try
assigning a default value to the parameter in the stored procedure or
query.

Just my 2 cents.

Thanks,

Matt

"TJ Nelson" <TJ******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
I don't have an answer on why it would be working in one place and not the
other, but have you tried putting your SQL into a stored procedure and
then
trying to use that? Just something to use for troubleshooting.

"NuB" wrote:
OK, here is the story, i have text boxes to allow the user enter
information
for a search. I have my SQL that has LIKE in the where clause, in the
query
builder the SQL works correctly, if nothing is entered all the data is
returned, if i enter in search criteria that data is returned. NOW, when
i
try to do the same exact thing on my web form, it does not work. the
grid
will only populate with data if I enter something in for search critia.
AND
the grid will not work if I have more then 1 parameter in my where
clause:
here is my SQL that works in the querybuilder

SELECT id, Officename, FirstName + ' ' + LastName AS FullName,
Region,
FROM dbo.SalesTeam
WHERE (@FirstName IS NULL OR
FirstName LIKE '%' + @FirstName ) AND (@LastName
IS
NULL OR
LastName LIKE '%' + @LastName ) AND (@Region IS
NULL
OR Region LIKE '%' + @Region ) )

why will this work in query builder but not on the web form?


Jan 20 '06 #5
ME
I found that the default DataSets don't work well with the inline controls.
I went back to the AutoGenerated datasets and messed with the Advanced
options for configuring the dataadapters for each table solved my problems
(Open the Designer for the DataSet and right click on one of the table
ADAPTERS (lower part of each table in the designer), then choose Configure,
then Advanced.

-Optimistic Concurrency throws some logic into the queries that check for a
@ISNULL_Parameter. These caused me grief as well until I learned the
corralation between the queries and DataGridView's DataKeyNames property.

- Refresh the DataTable adds a "select query" after each update, delete and
insert, that requires an @KEYNAME parameter that may not be passed when
performing udpates from the Controls. The Controls tend to pass only
"@ORIGINAL_KEYNAME" as the key to update or delete and do not seem to pass
@KEYNAME.

Thanks,

Matt

"NuB" <me@me.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
tried that, I have it working with passing 1 parameter but anymore then
that, nothing.

I'm thinking of just coding this in the code behind and screw this inline
model
"ME" <tr*********@comcast.netREMOVETHIS> wrote in message
news:9M********************@comcast.com...
Perhaps the control is passing NULL and not DBNULL. You might try
assigning a default value to the parameter in the stored procedure or
query.

Just my 2 cents.

Thanks,

Matt

"TJ Nelson" <TJ******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
I don't have an answer on why it would be working in one place and not
the
other, but have you tried putting your SQL into a stored procedure and
then
trying to use that? Just something to use for troubleshooting.

"NuB" wrote:

OK, here is the story, i have text boxes to allow the user enter
information
for a search. I have my SQL that has LIKE in the where clause, in the
query
builder the SQL works correctly, if nothing is entered all the data is
returned, if i enter in search criteria that data is returned. NOW,
when i
try to do the same exact thing on my web form, it does not work. the
grid
will only populate with data if I enter something in for search critia.
AND
the grid will not work if I have more then 1 parameter in my where
clause:
here is my SQL that works in the querybuilder

SELECT id, Officename, FirstName + ' ' + LastName AS FullName,
Region,
FROM dbo.SalesTeam
WHERE (@FirstName IS NULL OR
FirstName LIKE '%' + @FirstName ) AND (@LastName
IS
NULL OR
LastName LIKE '%' + @LastName ) AND (@Region IS
NULL
OR Region LIKE '%' + @Region ) )

why will this work in query builder but not on the web form?



Jan 20 '06 #6
ME
One last irratation. I noticed that if you use a SQL AutoGenerated ID the
DataSet does not correctly populate the Seed value. .NET starts its
autogeneration at Zero whereas SQL defaults to 1. I had to also update each
table's seed value to 1 after the Dataset was created.

Thanks,

Matt
"ME" <tr*********@comcast.netREMOVETHIS> wrote in message
news:I9******************************@comcast.com. ..
I found that the default DataSets don't work well with the inline controls.
I went back to the AutoGenerated datasets and messed with the Advanced
options for configuring the dataadapters for each table solved my problems
(Open the Designer for the DataSet and right click on one of the table
ADAPTERS (lower part of each table in the designer), then choose Configure,
then Advanced.

-Optimistic Concurrency throws some logic into the queries that check for
a @ISNULL_Parameter. These caused me grief as well until I learned the
corralation between the queries and DataGridView's DataKeyNames property.

- Refresh the DataTable adds a "select query" after each update, delete
and insert, that requires an @KEYNAME parameter that may not be passed
when performing udpates from the Controls. The Controls tend to pass only
"@ORIGINAL_KEYNAME" as the key to update or delete and do not seem to pass
@KEYNAME.

Thanks,

Matt

"NuB" <me@me.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
tried that, I have it working with passing 1 parameter but anymore then
that, nothing.

I'm thinking of just coding this in the code behind and screw this inline
model
"ME" <tr*********@comcast.netREMOVETHIS> wrote in message
news:9M********************@comcast.com...
Perhaps the control is passing NULL and not DBNULL. You might try
assigning a default value to the parameter in the stored procedure or
query.

Just my 2 cents.

Thanks,

Matt

"TJ Nelson" <TJ******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
I don't have an answer on why it would be working in one place and not
the
other, but have you tried putting your SQL into a stored procedure and
then
trying to use that? Just something to use for troubleshooting.

"NuB" wrote:

> OK, here is the story, i have text boxes to allow the user enter
> information
> for a search. I have my SQL that has LIKE in the where clause, in the
> query
> builder the SQL works correctly, if nothing is entered all the data is
> returned, if i enter in search criteria that data is returned. NOW,
> when i
> try to do the same exact thing on my web form, it does not work. the
> grid
> will only populate with data if I enter something in for search
> critia. AND
> the grid will not work if I have more then 1 parameter in my where
> clause:
> here is my SQL that works in the querybuilder
>
> SELECT id, Officename, FirstName + ' ' + LastName AS FullName,
> Region,
> FROM dbo.SalesTeam
> WHERE (@FirstName IS NULL OR
> FirstName LIKE '%' + @FirstName ) AND (@LastName
> IS
> NULL OR
> LastName LIKE '%' + @LastName ) AND (@Region IS
> NULL
> OR Region LIKE '%' + @Region ) )
>
> why will this work in query builder but not on the web form?
>
>
>



Jan 20 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kayodeok | last post by:
We're Mad As Hell And We're Not Going To Take It Anymore http://hownow.brownpau.com/index.html The web is a mess. We're tired of this deluge of <font> tags, nested tables, spacer GIFs, and...
3
by: .DLL hell II - The Evil Empire Strikes Back | last post by:
I can't figure out how this side-by-side assembly stuff it supposed to work. I have a stack of four assemblies A has no references B references A & C C References A & B D References A, B and C...
22
by: Jim Hubbard | last post by:
I am reposting a portion of a thread that I am involved in under a new topic because it seems that there are still people that believe the whole "DLL Hell" myth. I hope I can shed some light on...
2
by: Nad | last post by:
Hello, dll hell has been eliminated in .NET using assembly versioning. I am new in .NET and would like to know if there is any dll-hell-equivalent in .NET Windows or Web development...
21
by: Nx | last post by:
Hi I am unpacking a list into variables, for some reason they need to be unpacked into variable names like a0,a1,a2....upto aN whatever is in the list. How to create the variables dynamically...
1
by: GreatB | last post by:
Bill Gates died in a car accident. He found himself in Purgatory being sized up by God . .. "Well, Bill, I'm really confused on this call. I'm not sure whether to send you to Heaven or Hell....
18
by: Dave Sauny | last post by:
Ok, its a friday, I'm at work and I cant get this to work: I have 3 listboxes on one tab control page. when i select an item in listbox1 i want whatever is selected on the other 2 listboxes...
3
by: fyleow | last post by:
I just spent hours trying to figure out why even after I set my SQL table attributes to UTF-8 only garbage kept adding into the database. Apparently you need to execute "SET NAMES 'utf8'" before...
2
by: Scott M. | last post by:
I need a little help please... I'm simply trying to set up a very basic event for a class and then create an event handler for that class in a Console application. I think I'm very close, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.