Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 8th, 2007, 10:07 AM
Authorized User
 
Join Date: May 2007
Location: Fairfax, va, USA.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default what I am passing to PROC - VB.net

Hi all...
I have a sql server Proc that I am passing data to. The user populates a text box with a number of days (so I can calculate a date that will give the user results from a number of days back to current date). Anyway, I am converting the txt field to a int32 using convert.toint32 and setting it to zero(0) when the user does not elect to put in days (but search with some other data field - such as street name). I do a msgbox in my code to see the value of what I am sending and it says 0 (zero) but the query in the proc is not seeing it as such.

My question is - how can I see not only the value of the field I am sending but also the format (char, int, etc...)?
Reply With Quote
  #2 (permalink)  
Old June 8th, 2007, 10:18 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there... if you are sending zero it's doesn't matter the type of it.. how are you calling the SP?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #3 (permalink)  
Old June 8th, 2007, 10:22 AM
Authorized User
 
Join Date: May 2007
Location: Fairfax, va, USA.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not calling it in the VB.net code but in the sqlDataSource that I created in Visual Studio 2005. I have the textfield mapped correctly in the configuration I think.
Reply With Quote
  #4 (permalink)  
Old June 8th, 2007, 10:30 AM
Authorized User
 
Join Date: May 2007
Location: Fairfax, va, USA.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

to clarify... when the user presses the search button, i have a invisible text box that I initialize to 0 in case the user does not put anything in the textbox on the screen. I am doing this because the user can either reset the form after doing one search or press other buttons and type in search parameters into other fields. I init the inv fields on form when search is pressed. Then I see what buttons are pressed and if they are, populate inv fields with data to send to PROC.
Reply With Quote
  #5 (permalink)  
Old June 8th, 2007, 10:30 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

and when are you making the convertion?? maybe you are doing after the calling to the SP??

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #6 (permalink)  
Old June 8th, 2007, 10:36 AM
Authorized User
 
Join Date: May 2007
Location: Fairfax, va, USA.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hmmm. i am not sure. the sqldatasource is bound to my gridview where the data is returned. the last statement in my search button VB.net code is to make the gridview visible.
Reply With Quote
  #7 (permalink)  
Old June 8th, 2007, 10:41 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

if the SP is working if you put a number in there (even a zero) then you are passing a blank field to the SP... maybe better than have hidden fields is to put a validating control that make the field obligatory. That way you are sure that the field has data on it...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #8 (permalink)  
Old June 8th, 2007, 10:43 AM
Authorized User
 
Join Date: May 2007
Location: Fairfax, va, USA.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am pretty sure this is correct. i process other search parameters to this same proc and they are passed in correctly. the difference between them and this field is that they have been defined as nvarchar in the proc and this one is defined as int in the proc.
Reply With Quote
  #9 (permalink)  
Old June 8th, 2007, 10:50 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Sure that your problem is with this parameter not being passed like it should.. you are probably passing a null value to the sp and that's why it fails... another thing you can do is change it to nvarchar and do the conversion in the SP.

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #10 (permalink)  
Old June 8th, 2007, 11:41 AM
Authorized User
 
Join Date: May 2007
Location: Fairfax, va, USA.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Gbianchi. I will try that.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Output Parm From St Proc to DTS Package lwendt33 SQL Server DTS 2 February 2nd, 2005 05:15 PM
Passing variables into the SELECT of Stored Proc kerrj SQL Language 1 October 15th, 2003 06:00 AM
Passing variables into the SELECT of Stored Proc kerrj SQL Server 2000 0 October 14th, 2003 10:16 PM
Passing Parameters to Stored Proc mdillard Classic ASP Professional 6 June 10th, 2003 10:35 PM



All times are GMT -4. The time now is 05:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.