473,513 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Stored Procedure in SqlDataSource Won't Workd

When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 28 '06 #1
9 2203
Ron
Just a thought...
Are you using optimistic concurrency where the WHERE clause is finding no
results. I believe in this case no error is returned, but nor are any rows.

Good luck in fixing the problem.

Regards

Ron.

"Dan Sikorsky" <Da*********@discussions.microsoft.comwrote in message
news:CB**********************************@microsof t.com...
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE,
the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS

Jul 28 '06 #2
chances are you havent set up a default value for your parameter and/or set
it to a control/querystring etc etc.

so when the grid loads it wants a value for its parameter question becomes
where does it get it from?
"Dan Sikorsky" wrote:
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 29 '06 #3
I don't think your comment applies ... remember, I get the rows when I do a
Test Query in th SqlDataSource control, which is the datasource of the
GridView, but no rows when I run the web app.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Ron" wrote:
Just a thought...
Are you using optimistic concurrency where the WHERE clause is finding no
results. I believe in this case no error is returned, but nor are any rows.

Good luck in fixing the problem.

Regards

Ron.

"Dan Sikorsky" <Da*********@discussions.microsoft.comwrote in message
news:CB**********************************@microsof t.com...
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE,
the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS


Jul 29 '06 #4
I have one parameter which I get in the Page_Load event from
Request.Servervariables("LOGON_USER"), and have verified that it is set to a
loginid.

I store this loginid in a Property that stores the value in the ViewState.

I use a TextBox control that has a style=display:none, and a Text value set
to the Property.

Finally, I have a SqlDataSource SELECT control parameter set to the TextBox
control.

Should I use the Page_PreRender event instead?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Sean" wrote:
chances are you havent set up a default value for your parameter and/or set
it to a control/querystring etc etc.

so when the grid loads it wants a value for its parameter question becomes
where does it get it from?
"Dan Sikorsky" wrote:
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 29 '06 #5
I think you are on the right track when thinking about the page lifecycle.
I think your best bet would be one of the events of the SQLDataSource
control or the gridview control istelf.
Perhaps the gridviews databinding event.
Also maybe you could access the Requesti.Servervariables("LOGIN_USER")
directly instead of pasing it to another control. If you follow what I am
suggesting

"Dan Sikorsky" wrote:
I have one parameter which I get in the Page_Load event from
Request.Servervariables("LOGON_USER"), and have verified that it is set to a
loginid.

I store this loginid in a Property that stores the value in the ViewState.

I use a TextBox control that has a style=display:none, and a Text value set
to the Property.

Finally, I have a SqlDataSource SELECT control parameter set to the TextBox
control.

Should I use the Page_PreRender event instead?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Sean" wrote:
chances are you havent set up a default value for your parameter and/or set
it to a control/querystring etc etc.

so when the grid loads it wants a value for its parameter question becomes
where does it get it from?
"Dan Sikorsky" wrote:
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.
>
How do I get this working?
>
--
Thank you kindly,
>
Dan Sikorsky BA, BSCE, MCS
Jul 29 '06 #6
I put a breakpoint on the SqlDataSource OnSelecting event and the
e.Command.Parameters[0] says the loginid is there; so it is being passed to
the Stored Procedure.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Sean" wrote:
I think you are on the right track when thinking about the page lifecycle.
I think your best bet would be one of the events of the SQLDataSource
control or the gridview control istelf.
Perhaps the gridviews databinding event.
Also maybe you could access the Requesti.Servervariables("LOGIN_USER")
directly instead of pasing it to another control. If you follow what I am
suggesting

"Dan Sikorsky" wrote:
I have one parameter which I get in the Page_Load event from
Request.Servervariables("LOGON_USER"), and have verified that it is set to a
loginid.

I store this loginid in a Property that stores the value in the ViewState.

I use a TextBox control that has a style=display:none, and a Text value set
to the Property.

Finally, I have a SqlDataSource SELECT control parameter set to the TextBox
control.

Should I use the Page_PreRender event instead?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Sean" wrote:
chances are you havent set up a default value for your parameter and/or set
it to a control/querystring etc etc.
>
so when the grid loads it wants a value for its parameter question becomes
where does it get it from?
>
>
"Dan Sikorsky" wrote:
>
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 29 '06 #7
Then I am at a loss other then perphaps that userid doesnt exist in the
database.
Naturally it might be that the user value simply doesnt exist in the table
but as you say you already tried it out generating a query.

I am currently investigating very mysterious problems I am having with the
SQLDatasource control referencing sproc signatures that no longer exist. Its
been very troubling.

"Dan Sikorsky" wrote:
I put a breakpoint on the SqlDataSource OnSelecting event and the
e.Command.Parameters[0] says the loginid is there; so it is being passed to
the Stored Procedure.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Sean" wrote:
I think you are on the right track when thinking about the page lifecycle.
I think your best bet would be one of the events of the SQLDataSource
control or the gridview control istelf.
Perhaps the gridviews databinding event.
Also maybe you could access the Requesti.Servervariables("LOGIN_USER")
directly instead of pasing it to another control. If you follow what I am
suggesting

"Dan Sikorsky" wrote:
I have one parameter which I get in the Page_Load event from
Request.Servervariables("LOGON_USER"), and have verified that it is set to a
loginid.
>
I store this loginid in a Property that stores the value in the ViewState.
>
I use a TextBox control that has a style=display:none, and a Text value set
to the Property.
>
Finally, I have a SqlDataSource SELECT control parameter set to the TextBox
control.
>
Should I use the Page_PreRender event instead?
>
--
Thank you kindly,
>
Dan Sikorsky BA, BSCE, MCS
>
>
"Sean" wrote:
>
chances are you havent set up a default value for your parameter and/or set
it to a control/querystring etc etc.

so when the grid loads it wants a value for its parameter question becomes
where does it get it from?


"Dan Sikorsky" wrote:

When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.
>
How do I get this working?
>
--
Thank you kindly,
>
Dan Sikorsky BA, BSCE, MCS
Jul 29 '06 #8
Post your problem and let me know where it is; I'll take a look at it.

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Sean" wrote:
Then I am at a loss other then perphaps that userid doesnt exist in the
database.
Naturally it might be that the user value simply doesnt exist in the table
but as you say you already tried it out generating a query.

I am currently investigating very mysterious problems I am having with the
SQLDatasource control referencing sproc signatures that no longer exist. Its
been very troubling.

"Dan Sikorsky" wrote:
I put a breakpoint on the SqlDataSource OnSelecting event and the
e.Command.Parameters[0] says the loginid is there; so it is being passed to
the Stored Procedure.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Sean" wrote:
I think you are on the right track when thinking about the page lifecycle.
I think your best bet would be one of the events of the SQLDataSource
control or the gridview control istelf.
Perhaps the gridviews databinding event.
Also maybe you could access the Requesti.Servervariables("LOGIN_USER")
directly instead of pasing it to another control. If you follow what I am
suggesting
>
"Dan Sikorsky" wrote:
>
I have one parameter which I get in the Page_Load event from
Request.Servervariables("LOGON_USER"), and have verified that it is set to a
loginid.

I store this loginid in a Property that stores the value in the ViewState.

I use a TextBox control that has a style=display:none, and a Text value set
to the Property.

Finally, I have a SqlDataSource SELECT control parameter set to the TextBox
control.

Should I use the Page_PreRender event instead?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS


"Sean" wrote:

chances are you havent set up a default value for your parameter and/or set
it to a control/querystring etc etc.
>
so when the grid loads it wants a value for its parameter question becomes
where does it get it from?
>
>
"Dan Sikorsky" wrote:
>
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 31 '06 #9
Fixed.

A string parameter was being passed to the stored procedure as Nothing/Null.
By setting this parameter to "" in the SqlDataSource_OnSelecting event
handler resolved the problem.

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Dan Sikorsky" wrote:
When I hit the Test Query button in the SqlDataSource design, all the rows
come back. But when I run the website, without any changes, in the IDE, the
GridView tied to the SqlDataSoure is empty.

How do I get this working?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Aug 4 '06 #10

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

Similar topics

3
11271
by: michelle | last post by:
I am trying to get an output value from a stored procedure using sqlDataSource in asp.net 2.0. But I only get a null value for the output. Can someone please help? The sqlDataSource: ...
3
5143
by: mahajanvit | last post by:
Hi one and all I got this problem during my project. So in order to solve this I made a very small application. I am trying to insert using SP and sqldatasource control. I know that while using...
0
2240
by: Brew | last post by:
Hello, I'm writing an ASP.NET 2005 (VB) Website with an Oracle 9i backend I have an oracle package with stored procedures and functions I need to use from the VB Code, I'm trying to use the...
1
6843
by: ryanb31 | last post by:
When I call databind on my gridview which uses a SqlDataSource as its DataSourceID, after 30 seconds I get the error "Timeout expired. The timeout period elapsed prior to completion of the...
0
2136
by: george | last post by:
Hi world! Anyone experienced building gridview in Oracle environment using stored procedures, please help! Right now, I have issues using Oracle SP, I spent a whole day on this and still...
4
2593
by: Wannabe | last post by:
I am using ASP.Net 2.0 and have a gridview on my page. I have everything working except the delete command. The page reloads except the row I am trying to delete is still there. I believe it is...
1
6112
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
12
4687
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that...
0
1737
by: =?Utf-8?B?X3ByZWZpeA==?= | last post by:
Hello All, I have written a page with a sqlserverdatasource control and a formview web control. I want to use stored procedures to perform CRUD operations. Formview textboxes bind to table...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
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
7545
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...
1
7111
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
7539
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
5692
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
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.