CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.microsoft_application_blocks Tags:
Item Type: NewsGroup Date Entered: 3/15/2004 10:55:53 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 10 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
eemece2
Asp.Net User
DateTime parameters3/15/2004 10:55:53 AM

0/0

Hello,

The following code and procedure doesn't work correctly. The SqlDataReader result is nothing.
It seems to bee a problem with the datetime parameters. (Without datetime parameters works OK)

Could you help me?
Thank you.


Dim conexion As String = ConfigurationSettings.AppSettings("ConexionSql")

Dim arParams(4) As SqlParameter
Dim fecha As DateTime
arParams(1) = New SqlParameter("@afiliadoId", "1")
fecha = Today
arParams(2) = New SqlParameter("@fIni", fecha)
fecha.AddDays(100)
arParams(3) = New SqlParameter("@fFin", fecha)

Dim reader As SqlDataReader = _
SqlHelper.ExecuteReader(conexion, _
CommandType.StoredProcedure, "wm_getReservasAfiliado", arParams)

dgReservas.DataSource = reader
dgReservas.DataBind()


and the stored procedure:


PROCEDURE dbo.wm_getReservasAfiliado
@afiliadoId as char(10),
@fIni as datetime,
@fFin as datetime
AS

SELECT [reservaId], [Fecha], [afiliadoId], [clienteRemoto], [telefonoRemoto], [estado] FROM [wm_reservas]
WHERE ((afiliadoId = @afiliadoId) and([Fecha] between @fIni and @fFin) )
ericlandes
Asp.Net User
Re: DateTime parameters3/16/2004 1:25:17 PM

0/0

How about if you typed your params?

fecha = Today
arParams(2) = New SqlParameter("@fIni", DateTime)
arParams(2).Value = fecha

That's how I normally do my parameters, and have not had a problem with DateTime parameters.

Eric Landes

MADNUG President http://www.madnug.net
Crystal Alliance Editor
Blog http://aspadvice.com/blogs/elandes
Microsoft MVP
2 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

DateTime parameters - ng.asp-net-forum.microsoft_application_blocks ... DateTime parameters, > ROOT > NEWSGROUP > Asp.Net Forum > ... Parameters value A DateTime to compare with the ... Reporting Services datetime parameters. ...
How to Record DateTime on login ? plus : ReturnUrl question - newsgroup ... How to Record DateTime on login ? plus : ReturnUrl question, > ROOT > NEWSGROUP > Asp.Net Forum > general_asp.net. ... i must use parameters to build the ...
Glossary of Terms on EQ Maps USGS Earthquake Hazards Program, responsible for monitoring, ... Parameters. These parameters provide information on the reliability of the earthquake ...
CalendarModules - Perl DateTime Wiki A module belongs under the DateTime::Calendar namespace if it implements a ... Parameters ... The first element is the Rata Die day for the datetime in question. ...
datetime Use NLS parameters and formatting for datetime datatypes. Prerequisites ... and NLS parameters for datetime datatypes. ... NLS Parameters for Datetime Datatypes ...
FAQBasicUsage - Perl DateTime Wiki All parameters are optional except for year. The defaults are shown for the other parameters: ... my $dt1 = DateTime->new( year => 2003, month => 1, day => 1, ...
DateTime - A date and time object - search.cpan.org The time_zone parameter can be either a scalar or a DateTime::TimeZone object. ... simply be passed to the DateTime::TimeZone->new method as its "name" parameter. ...
DateTime A date and time object ... All constructors can die when invalid parameters are given. * DateTime->new ... parameter should be a string matching one of the ...
DateTime - A date and time object - search.cpan.org All constructors can die when invalid parameters are given. DateTime->new ... The time_zone parameter can be either a scalar or a DateTime::TimeZone object. ...
Set NULL to datetime parameter - MSDN Forums MSDN Forums " SQL Server " SQL Server Reporting Services " Set NULL to datetime parameter ... while trying to set "NULL" value to my datetime parameters. ...
Format Models For lists of number and datetime format model elements, see Table 2-14, "Number ... Oracle Database Globalization Support Guide for information on these parameters ...
VisAD: Class DateTime Parameters: timeValue - value of time in timeUnits. timeUnits - units of value. DateTime ... Parameters: date - date object. Throws: VisADException - unit ...



 
All Times Are GMT